Skip to content

fix(ci): decode failure-class history as UTF-8 - #10844

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-failure-class-git-encoding
Jul 29, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-failure-class-git-encoding

Conversation

@tianmind-studio

@tianmind-studio tianmind-studio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Decode git log output as UTF-8 in the failure-class guard-artifact ratchet instead of relying on the host locale. Git emits repository history as UTF-8, while native Windows Python used GBK here; a non-ASCII first-parent commit caused the subprocess reader thread to fail and left stdout as None, followed by an AttributeError in the ratchet.

Make the checker's two disposable-repository tests use Python TemporaryDirectory cleanup instead of invoking the POSIX-only rm executable. This lets the complete checker module run under native Windows.

Product invariants affected

none

How it was verified

  • Before the fix, the real repository scan failed with UnicodeDecodeError: 'gbk' codec can't decode byte 0x94, then AttributeError: 'NoneType' object has no attribute 'split'.
  • After the fix, the real 90-day first-parent scan completed successfully with 23 declared classes.
  • .github/scripts/test_check_failure_class_guard_ratchet.py: 14 tests passed on native Windows; before the cleanup fix, 12 passed and 2 errored because rm was unavailable.
  • Ruff 0.4.4 passed.
  • Pyright 1.1.403 passed with 0 errors and 0 warnings.
  • py_compile and git diff --check passed.

Tests

The new regression supplies non-ASCII history text and verifies the production Git subprocess explicitly requests UTF-8. Existing end-to-end repositories continue to cover thresholds, artifacts, grandfathering, shallow history, short history, PR-body declarations, and the shipped registry.

Failure class (fixes)

Failure-Class: none

Review in cubic

@tianmind-studio

tianmind-studio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Integration follow-up: this head was stacked with the current Windows preflight fixes and exercised through the official make preflight. Both failure-class-guard-artifact-ratchet and its full 14-test fixture check passed, and the entire 30-check manifest run passed in 223.41s on native Windows.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused CI portability fix. I reviewed the diff and ran the guard-ratchet test module locally on the PR head (fab8999e0): 14 tests passed.

This looks like a good candidate from an implementation standpoint: run_git() now decodes Git output as UTF-8 instead of relying on the host locale, the regression covers non-ASCII history text, and the temporary repository cleanup is made portable by replacing the POSIX-only rm calls with TemporaryDirectory cleanup.

I’m not formally approving because this touches CI/guardrail scripts, so it should still get human maintainer review before merge, but I don’t see blocking changes needed from this automation review.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added candidate-clean-pr Small, safe, well-scoped, well-tested contribution; model clean PR workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-maintainer-review Needs a human maintainer to sign off before merge labels Jul 29, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real crash with a named root cause: git log decoded via host locale (GBK on Windows) returned None stdout then AttributeError. Explicit UTF-8 decode plus a non-ASCII-history regression; also drops a POSIX-only rm from the tests. Green.

@kodjima33
kodjima33 merged commit d99646b into BasedHardware:main Jul 29, 2026
40 of 42 checks passed
kodjima33 pushed a commit that referenced this pull request Sep 1, 2026
* fix(preflight): decode gh metadata as UTF-8

Decode captured gh PR JSON with the producer's UTF-8 encoding instead of the Windows host code page. Add a Unicode metadata contract and register the recurring subprocess locale failure class with #10595 and #10844 as evidence.

Tests: MetadataTests passed 14/14; the real #10823 body loaded under preferred_encoding=cp936; Ruff, Black, py_compile, and diff checks passed.

Failure-Class: new

* fix(preflight): propagate UTF-8 through Windows runner

* fix(preflight): pin suggestion subprocess UTF-8

* test(preflight): pin nested subprocess UTF-8

* fix(preflight): emit direct Windows output as UTF-8

---------

Co-authored-by: 491034170 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

candidate-clean-pr Small, safe, well-scoped, well-tested contribution; model clean PR needs-maintainer-review Needs a human maintainer to sign off before merge workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants