Skip to content

fix(control-plane): pin UTF-8 on the packaged stride schema read - #6353

Closed
JasonBuildAI wants to merge 1 commit into
loopx-project:mainfrom
JasonBuildAI:codex/scan-b3k7
Closed

JasonBuildAI wants to merge 1 commit into
loopx-project:mainfrom
JasonBuildAI:codex/scan-b3k7

Conversation

@JasonBuildAI

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

Author Declaration

  • Written by: model_agent (OpenAI Codex), operating under the human operator's direction and review.
  • AI disclosure: this change was drafted with AI assistance at my request, under my direction and review.

Implemented against

Criterion (spec clause) Disposition Symbol / path Test or command
Shipped-runtime text reads and writes pin UTF-8 (guard docstring; #4941 / #4338 / #4942 / #4997 class) implemented loopx/control_plane/work_items/stride_policy_codec.py:16 uv run --extra test python -m pytest -q tests/test_loopx_text_io_utf8.py
The locale read does not reopen for stride_strategy_options() / normalize_stride_strategy() consumers implemented same guard test; tests/capabilities/test_machine_configuration_goal_defaults.py; tests/control_plane/test_replan_host_context_projection.py
  • Self-check before submission: read the guard contract, the guard helper scan, and the codec module; ran the guard before and after, the sibling subprocess-UTF-8 guard, the stride configuration and replan-projection tests, ruff on the changed file, git 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

  • Completed scope and remaining work: complete within this scope - the single offending site is fixed; no follow-up is required.
  • Slice boundary / successor: N/A (self-contained repair; nothing else in the module reads or writes text).

Validation

  • Tested revision: cf193cf16623565385d1c3be3e30c0cf2148eb9a
  • Run state: finished
  • Input classes: public_fixture
Check kind Result Public-safe evidence / limitation
static passed uv run --extra test python -m ruff check loopx/control_plane/work_items/stride_policy_codec.py: all checks passed
static passed scripts/generate_semantic_inventory.py --changed-from HEAD (advisory): no supported new-vocabulary carriers in the diff
static passed git diff --check clean; loopx check --scan-path <changed file>: errors=0, warnings=0, public boundary scan clean
unit passed Guard before/after: 1 failed, 1 passed on main 64bfb8343 (offender loopx/control_plane/work_items/stride_policy_codec.py:16) -> 2 passed on this head
unit passed tests/test_runtime_subprocess_utf8.py, tests/capabilities/test_machine_configuration_goal_defaults.py, tests/control_plane/test_replan_host_context_projection.py: 33 passed
integration failed loopx canary premerge --from-git-diff --git-diff-base upstream/main on 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.py without npm ci; catalog-run-e2e-smoke.py, premerge-validation-gate-smoke.py, smoke-suite-runner-smoke.py on POSIX-vs-Windows path-separator assertions). All four reproduce identically at the base revision; the vocabulary smoke passes after the documented npm ci --ignore-scripts prerequisite. Inherited, unrelated to this diff
manual passed Locale probe on a cp936 host: the unguarded read_text() returns mojibake (round-trip false); encoding="utf-8" round-trips
  • Coverage and gaps: the diff is one codec-pinned read; the owning check is the platform-independent AST guard over loopx/**, which is the test this change restores. The full local pytest suite was not run by the author; the required pytest aggregate 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

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A (no viewport change)
  • Source data: none
  • Attention review: N/A (no viewport change)
  • Craft review: N/A (no viewport change)

Type of Change

  • Bug fix

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

  • Direction / acceptance reference, when applicable: N/A - ordinary repaired-defect maintenance; no roadmap/RFC dependency.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A - no RFC progress claimed.
  • Provider conformance arms run: N/A
  • Read-only legacy/file/PostgreSQL three-arm rehearsal (required for promotion, runtime-routing, or compatibility-projection changes): N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

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>
@mergify

mergify Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @JasonBuildAI.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Oct 13, 2026
@JasonBuildAI

Copy link
Copy Markdown
Contributor Author

The same one-line fix landed on main independently while this PR was being prepared: 156eee4c9 ("fix(control-plane): reuse frontier counters and pin resource UTF-8", merged with ca01854f4 via #6318) pins encoding="utf-8" on the same read_text() call, and tests/test_loopx_text_io_utf8.py now passes on main (verified 2 passed against b0b2acffb). The remaining delta in this PR is only a line wrap, so it is redundant.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: shipped-runtime UTF-8 guard fails on main - the stride schema asset is read with the host locale codec

1 participant