Skip to content

Fix Encoding Gate Order, Installer Self-Test UTF-8, Signal Window, and Doc Findings - #4343

Merged
ptr727 merged 8 commits into
developfrom
fix/encoding-gate-mapping-order
Nov 22, 2026
Merged

ptr727 merged 8 commits into
developfrom
fix/encoding-gate-mapping-order

Conversation

@ptr727

@ptr727 ptr727 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes the verified Copilot and CodeRabbit findings on promotion PR #4342.

  • The encoding test gate reads a dictionary display, a | merge, and a dict(...) call in order. A dict(...) keyword is final. A name lookup stops at a function parameter or an assignment. A rebinding or a non-literal mutation after an item write has to carry the variable too. Regression tests cover each shape.
  • The installer's self-test child gets PYTHONIOENCODING=utf-8, with a test that sets a cp1252 parent value.
  • The installer entry points are typed, and main() starts its try before the signal handlers register, with a test for a signal right after registration.
  • The readiness waits in the interrupt tests have a deadline that kills a stalled child and keeps its output for the failure.
  • The upstream-contribution-workflow skill no longer rewrites an append-only clean branch, and its rebase chain stops after the rebase where the old head carried a merge commit. Its generated copies are rebuilt.
  • The CodeRabbit configuration source in docs/pr-reviewer-reference.md is qualified for a trusted same-repository pull request, a fork, and the configuration-source setting.

This touches host-setup/agent-safety/claude/, so it waits for the maintainer's go-ahead before merging.

Closes on promotion: none

Pre-existing findings, not filed

  • tests/test_tooling_encoding.py, _name_carries rebinding path: a later mutation after a rebinding that sets PYTHONIOENCODING, such as env.update(os.environ), is not read. Class: pre-existing, a gate gap on a shape no call in the repository uses.
  • tests/test_tooling_encoding.py, _name_carries rebinding path: a rebinding that reads the name and itself sets the variable is flagged though it carries it. Class: pre-existing, conservative false positive on a shape no call in the repository uses.

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 22, 2026 09:06
…elf-Test

The encoding gate counted an earlier PYTHONIOENCODING entry as enough
even where a later unpacking overwrote it. It now applies each entry and
unpacking in order. The installer's self-test child decoded as UTF-8
without being told to emit it, and the test helper let extra_env override
the entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dict() keyword cannot be given twice, so it decides wherever it sits.
An unpacked display that never names the variable no longer resets the
reading, and a | merge is read in order like an unpacking. The test
helper's reorder is dropped, since the keyword was already final.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 22, 2026
Copilot AI lite review requested due to automatic review settings November 22, 2026 17:14
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 127158d98f5ec8990f087a8ccc3bbbd0a2504436, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A remaining nit requests a regression test covering the child environment override, leaving the change without verification that the installer enforces UTF-8 under a non-UTF-8 parent setting.

1 open issue
What changed in this PR

This PR improves UTF-8 handling for Python child processes and makes encoding analysis respect environment updates in evaluation order.

Changes:

  • Adds ordered handling for dictionary displays, | merges, and dict(...) calls.
  • Adds regression coverage for environment unpacking and merge patterns.
  • Passes PYTHONIOENCODING=utf-8 to installer self-test subprocesses.
File Description
tests/​test_tooling_encoding.py Adds ordered environment analysis and regression tests for dictionary displays, merges, and unpacked mappings.
host-setup/​agent-safety/​claude/​install.py Sets PYTHONIOENCODING=utf-8 in the environment of installer self-test child processes.

Review effort: Lite

@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.55%. Comparing base (6c9aadf) to head (d61244c).

Files with missing lines Patch % Lines
host-setup/agent-safety/claude/install.py 76.92% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4343   +/-   ##
========================================
  Coverage    79.54%   79.55%           
========================================
  Files           45       45           
  Lines        15919    15923    +4     
========================================
+ Hits         12663    12667    +4     
  Misses        3256     3256           
Flag Coverage Δ
python-3.13 79.55% <76.92%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 82e48e30b74d82501d326d26c55c8e5174c784f2, the content this pull request carries at that commit against develop, and it recorded 0 findings.

ptr727 and others added 4 commits November 22, 2026 09:56
Keep an append-only clean branch unrewritten, read merge commits before a
rebase drops them, and qualify where CodeRabbit reads its configuration.
Type the installer entry points and start its try before the signal
handlers register. Bound the readiness waits in the interrupt tests. Make
the encoding gate stop a name lookup at a parameter and let a replacement
after an item write defeat the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the Gate

The rebase chain now stops after the rebase where the old head carried a
merge commit. The encoding gate lets a later self-reading rebinding or a
literal display through and defeats the call on a later update from the
environment. A readiness failure kills the child before reading its output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…by What They Add

The conflict path skipped the merge check, so it now names it. The
encoding gate no longer treats an item set as binding a name, includes
writes on the setting line, and judges a later self-reading rebinding on
what it adds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727 ptr727 changed the title Read the Child Environment in Order and Pass UTF-8 to the Installer Self-Test Fix Encoding Gate Order, Installer Self-Test UTF-8, Signal Window, and Doc Findings Nov 22, 2026
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head d61244c300282e21d8095e660e809cf7a60eb041, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@ptr727
ptr727 merged commit 4581d0d into develop Nov 22, 2026
14 checks passed
@ptr727
ptr727 deleted the fix/encoding-gate-mapping-order branch November 22, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants