Skip to content

fix(setup): preserve malformed UTF-8 config bytes (integrate #714) - #842

Open
tt-a1i wants to merge 2 commits into
mainfrom
codex/pr714-ready
Open

tt-a1i wants to merge 2 commits into
mainfrom
codex/pr714-ready

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Malformed UTF-8 in setup JSON is replacement-decoded and may be silently rewritten by an unrelated update.

Value

Preserve corrupt original bytes and refuse unsafe configuration writes.

Approach

Decode bytes once at inspectSetupConfig with fatal UTF-8 validation and retain BOM rejection. Preserve the existing diagnostics, runtime defaults, writer lock, mutation/apply and rollback ownership. No new setup choice or parser.

Integrates #714 onto current main. The original fork does not enable maintainer edits, so this companion retains its complete contributor history through a normal merge with fixed main f98d6a47; the original PR remains open. Frozen local head a2088d1f765e57ad3962be013c121022913ecaa5, tree 2bb414d2fe245e069062e4290df67a6d06452021.

Validation

Frozen install, typecheck, repository format/lint and diff checks pass. 94 focused tests passed, including invalid ff/overlong/truncated byte admission, zero mutate/apply, real registered setup caller rejection, valid ASCII/CJK/emoji/literal replacement character, unknown fields and exact rollback.

This is a byte-admission invariant; no installed Pi or provider call is needed. An external synthetic integration with #832 passes the corruption and lock/setup tests.

Two independent final source reviews passed on this exact head. Exact frozen-head bun run check and bun run test both exit 0: Node 2,458 passed / 9 skipped / 0 failed; UI 88 files / 1,338 passed. Head/tree/clean guards remain identical before and after. Fresh exact-head remote CI passed all 18 checks; the optional notification was skipped while draft. Independent last-push approval remains required.

Impact

User: existing unreadable-config diagnostics block writes. Model: no tools or schema change. Persistence: malformed files stay byte-identical. Runtime: lock, atomic writer and apply/rollback remain current-main owned.

@github-actions github-actions Bot added the area:setup OpenPI setup, configuration, or setup documentation label Oct 15, 2026
@tt-a1i
tt-a1i marked this pull request as ready for review October 15, 2026 08:58

This branch has not been deployed

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

Labels

area:setup OpenPI setup, configuration, or setup documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants