Repository navigation
fix(control-plane): pin UTF-8 on the packaged stride schema read - #6353
JasonBuildAI wants to merge 1 commit into
Conversation
The versioned stride control added in loopx-project#6298 reads the packaged stride_strategy_schema.json with Path.read_text() and no codec. That call decodes with the host locale codec (cp936 on zh-CN Windows), so the shipped-runtime UTF-8 guard tests/test_loopx_text_io_utf8.py (the loopx-project#4941 class guard from loopx-project#5160) fails on main, and the read sits on the CLI configuration path (configuration_ui, registry_admin_configure, execution_profile, machine_defaults). Pin encoding="utf-8" like the other shipped-runtime text reads. Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
|
The same one-line fix landed on Closing to avoid duplicate work; issue #6352 is resolved by that commit and is closed with a reference. I will not re-open this branch. |
Goal And Delivered Outcome
7a315eff2) addedloopx/control_plane/work_items/stride_policy_codec.py, which reads the packagedloopx/control_plane/stride_strategy_schema.jsonwithPath.read_text()and no codec. That broke the shipped-runtime UTF-8 guardtests/test_loopx_text_io_utf8.py(the [Bug]: Windows non-UTF-8 locale — Path text I/O decodes structured state files with the locale encoding #4941 class guard introduced with fix(usage-ping): pin UTF-8 on the state reads and guard the class #5160/fix(cli): pin the shipped CLI's own stdio to UTF-8 #6119), which fails on currentmainfor every contributor. The read sits on the CLI configuration path (capabilities/configuration_ui.py,cli_commands/registry_admin_configure.py,execution_profile.py,capabilities/todo_replan_cadence/machine_defaults.py), so on a non-UTF-8 host the schema would be decoded with the host locale codec.uv run --extra test python -m pytest -q tests/test_loopx_text_io_utf8.pyonmainat64bfb8343reports1 failed, 1 passednamingloopx/control_plane/work_items/stride_policy_codec.py:16; on this head it reports2 passed. Validation row:unit.main.Author Declaration
Implemented against
tests/test_loopx_text_io_utf8.py(revision64bfb8343ofmain) are the basis.loopx/control_plane/work_items/stride_policy_codec.py:16uv run --extra test python -m pytest -q tests/test_loopx_text_io_utf8.pystride_strategy_options()/normalize_stride_strategy()consumerstests/capabilities/test_machine_configuration_goal_defaults.py;tests/control_plane/test_replan_host_context_projection.pygit diff --check, the public/private boundary scan, the semantic-inventory advisory (no new vocabulary), and the risk-selected premerge canary; compared the canary's failing analyzer smokes against the same run on the base revision to separate inherited environment failures. Did not run the full local pytest suite; see Coverage and gaps.Scope And Continuation
Validation
cf193cf16623565385d1c3be3e30c0cf2148eb9afinishedpublic_fixturestaticpasseduv run --extra test python -m ruff check loopx/control_plane/work_items/stride_policy_codec.py: all checks passedstaticpassedscripts/generate_semantic_inventory.py --changed-from HEAD(advisory): no supported new-vocabulary carriers in the diffstaticpassedgit diff --checkclean;loopx check --scan-path <changed file>: errors=0, warnings=0, public boundary scan cleanunitpassed1 failed, 1 passedonmain64bfb8343(offenderloopx/control_plane/work_items/stride_policy_codec.py:16) ->2 passedon this headunitpassedtests/test_runtime_subprocess_utf8.py,tests/capabilities/test_machine_configuration_goal_defaults.py,tests/control_plane/test_replan_host_context_projection.py: 33 passedintegrationfailedloopx canary premerge --from-git-diff --git-diff-base upstream/mainon native Windows: diff hygiene, py_compile and the module-ceiling recollection check passed; four analyzer/canary smokes fail on this host (semantic-vocabulary-drift-smoke.pywithoutnpm ci;catalog-run-e2e-smoke.py,premerge-validation-gate-smoke.py,smoke-suite-runner-smoke.pyon POSIX-vs-Windows path-separator assertions). All four reproduce identically at the base revision; the vocabulary smoke passes after the documentednpm ci --ignore-scriptsprerequisite. Inherited, unrelated to this diffmanualpassedread_text()returns mojibake (round-trip false);encoding="utf-8"round-tripsloopx/**, which is the test this change restores. The full local pytest suite was not run by the author; the requiredpytestaggregate runs on CI. Four canary analyzer smokes fail identically on the base revision on this Windows host and are inherited rather than caused by this diff (named in the integration row).Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).