Repository navigation
docs(work-items): force UTF-8 wherever a body edit leaves the gh pipeline - #1340
Conversation
|
Claude finished @kyle-sexton's task in 1m 36s —— View job PR Review
Overall: looks good with one correctness nit in the Python remedies.
|
|
Claude finished @kyle-sexton's task in 42s —— View job Security Review — PR #1340
No security issues found. This PR is a pure documentation change across three files:
No executable code, no workflow modifications, no permission changes, no new dependencies or action pins, no secrets or credential handling, and no new external trust delegations are introduced. The code snippets in the new gotcha ( The guidance added actually reduces corruption risk for consumers doing out-of-pipeline body edits, which is a net positive for data integrity. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d4987116e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @kyle-sexton's task in 1m 25s —— View job Security Review — PR #1340
No security issues found. This PR changes three files, all documentation or metadata:
Surfaces checked:
The guidance added reduces data-corruption risk for consumers doing out-of-pipeline body edits; it is a net positive for data integrity with no new attack surface. |
|
Claude finished @kyle-sexton's task in 1m 27s —— View job PR Review — #1340
The prior review finding is resolved. This PR is ready to merge. Binary-mode fix (latest commit —
|
| Claim | Verdict |
|---|---|
gh transports (--json/--jq, gh api, >, --body-file) are byte-faithful |
✅ |
| Corruption path: UTF-8 read as ANSI, re-encoded, written back silently | ✅ |
| Em-dash U+2014 → U+00E2 U+20AC U+201D byte sequence | ✅ (documented in #1037) |
Python open() no-encoding = locale encoding (ANSI code page through 3.14) |
✅ |
| PEP 686 makes UTF-8 the default only in 3.15+ | ✅ |
PS 5.1 Get-Content defaults to ANSI; PS 6+ defaults to utf8NoBOM |
✅ |
PS 5.1 -Encoding utf8 prepends a BOM |
✅ |
utf8NoBOM not a valid enum value in PS 5.1 |
✅ |
[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false)) emits UTF-8 without BOM |
✅ |
PYTHONUTF8=1 enables UTF-8 mode (since Python 3.7) |
✅ |
Repo guidelines: No hardcoded paths, no PII/secrets, explicit semver bump, Conventional Commits PR title — all satisfied.
No issues found. The PR is correct, well-scoped, and aligned with the repo guidelines.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1721a16a9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review pass resolved —
|
1721a16 to
b907b0a
Compare
|
Claude finished @kyle-sexton's task in 2m 15s —— View job PR Review — #1340 (sync:
|
| Check | Verdict |
|---|---|
plugin.json patch bump 0.24.1 → 0.24.2 |
✅ |
CHANGELOG.md entry, Keep a Changelog format, Documentation heading |
✅ |
Python open(path, 'rb').read().decode('utf-8') (binary-mode fix from prior commit) |
✅ |
PYTHONUTF8=1 as an alternative |
✅ |
| PEP 686 / Python 3.15+ version scoping | ✅ |
PS 5.1 ANSI default vs PS 6+ utf8NoBOM version scoping |
✅ |
PS 5.1 -Encoding utf8 BOM hazard, utf8NoBOM invalid, WriteAllText workaround |
✅ |
| Repo guidelines (no hardcoded paths, no PII, Conventional Commits title, fresh-docs mandate) | ✅ |
The -Raw fix is the only remaining blocker. It's a one-word insertion on line 338. Note: I applied it locally (daea826) but the push was rejected by repository permissions — it needs to be committed directly to the branch.
|
Claude finished @kyle-sexton's task in 1m 3s —— View job Security Review — PR #1340
No security issues found. This PR changes three files, all documentation or metadata:
Surfaces checked:
The guidance added reduces data-corruption risk for consumers doing out-of-pipeline body edits, which is a net positive for data integrity with no new attack surface. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b907b0a93e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…line The GitHub adapter's read-modify-write shapes fetch an issue/comment body, edit it, and write it back. The `gh` transports involved (`--json`/`--jq`, `gh api`, the bash `>` redirect, `--body-file`) only move bytes, so those pipelines never transcode. An ad-hoc step that decodes the fetched bytes does transcode when its default is a legacy code page: the body's UTF-8 is read as Windows ANSI and re-encoded, and the corrupted copy is written back over the good one with every command exiting 0. Record it as a cross-cutting gotcha naming the two Windows defaults that decode this way (Python `open()` without `encoding=`, Windows PowerShell 5.1 `Get-Content`) and the explicit encoding to state on each side. The write half is version-split because Windows PowerShell 5.1 has no `utf8NoBOM` and its `-Encoding utf8` prepends a BOM that `--body-file` would then carry into the stored body. Closes #1037 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01NE8W4XPPVfZVCGBW2GYgyH
`.read().decode('utf-8')` raises AttributeError when followed literally
after a text-mode `open(path)` — `str` has no `.decode`. In a note about
encoding correctness the shorthand is worse than none, so spell out the
binary-mode open it assumed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NE8W4XPPVfZVCGBW2GYgyH
b907b0a to
af553ea
Compare
|
Claude finished @kyle-sexton's task in 3m 33s —— View job PR Review — #1340 (sync:
|
| Check | Verdict |
|---|---|
plugin.json patch bump to 0.24.4 |
✅ |
CHANGELOG.md entry, Keep a Changelog format, Documentation heading |
✅ |
gh byte-faithfulness claim |
✅ |
| Corruption mechanism (UTF-8 read as ANSI, re-encoded) | ✅ |
| Em-dash byte sequence U+00E2 U+20AC U+201D | ✅ |
Python open(path, 'rb').read().decode('utf-8') binary-mode fix (af553ea) |
✅ |
PYTHONUTF8=1 as an alternative |
✅ |
| PEP 686 / Python 3.15+ version scoping | ✅ |
PS 5.1 ANSI default vs PS 6+ utf8NoBOM version scoping |
✅ |
PS 5.1 -Encoding utf8 BOM hazard, utf8NoBOM invalid, WriteAllText workaround |
✅ |
| Repo guidelines (Conventional Commits title, no hardcoded paths, no PII, fresh-docs mandate) | ✅ |
The two findings above are the only remaining blockers. Both are one-line or near-one-line fixes.
|
Claude finished @kyle-sexton's task in 50s —— View job Security Review — PR #1340
No security issues found. This PR changes three files, all documentation or metadata:
Surfaces checked:
The guidance added reduces data-corruption risk for consumers doing out-of-pipeline body edits, which is a net positive for data integrity with no new attack surface. |
Rebased onto current
|
| version claimed | outcome | |
|---|---|---|
| first push | 0.24.2 |
taken by #1256 (e2e-probe labels) -> moved to 0.24.3 |
| second push | 0.24.3 |
taken by #1365 (discipline-rename prose) -> moved to 0.24.4 |
Now 0.24.4, with 0.24.2 and 0.24.3 intact below it. The diff is still exactly the same three files and 25 insertions it was at review time — no content was dropped or re-litigated in either rebase.
One detail worth flagging for whoever merges, since git did not: only the CHANGELOG.md heading conflicts; plugin.json merges cleanly to the wrong value. A one-line "version" change auto-merges to whatever main last set, so a rebase that resolves only the marked conflict silently ships a manifest version that disagrees with the changelog entry above it. The repo's check-changelog-parity.sh --check-bump gate catches exactly that, and it passes here — but it is worth knowing the clean-looking half is the one that needs checking. Verified locally against origin/main before each push, alongside markdownlint / typos / editorconfig and a byte-level check that neither file picked up mojibake or CRLF through the conflict resolution.
If a third work-items PR lands before this merges, the same one-line bump applies.
This was generated by AI (autonomous work-loop lane).
|
Claude finished @kyle-sexton's task in 1m 15s —— View job PR Review — #1340 (sync:
|
| Claim | Verdict |
|---|---|
gh transports (--json/--jq, gh api, >, --body-file) are byte-faithful |
✅ |
| Corruption: UTF-8 read as ANSI, re-encoded, written back silently (all exits 0) | ✅ |
| Em-dash U+2014 → U+00E2 U+20AC U+201D | ✅ |
Python open() no-encoding = ANSI code page through 3.14; PEP 686 flips default in 3.15 |
✅ |
open(path, 'rb').read().decode('utf-8') — binary mode, bytes.decode() valid |
✅ |
open(path, 'w', encoding='utf-8') — write-side encoding |
✅ |
PYTHONUTF8=1 covers both read and write sides |
✅ |
PS 5.1 Get-Content defaults to ANSI; PS 6+ defaults to utf8NoBOM |
✅ |
Get-Content -Raw returns one multiline string vs string[] |
✅ |
PS 5.1 -Encoding utf8 prepends BOM; utf8NoBOM invalid in 5.1 |
✅ |
[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false)) — UTF-8 no BOM |
✅ |
"PowerShell 6+ has both" (utf8 BOM and utf8NoBOM) |
✅ |
Metadata
plugin.json version is 0.24.4; CHANGELOG.md [0.24.4] heading and Documentation entry are consistent and follow the repo's Keep a Changelog conventions.
Repo guidelines
No hardcoded paths, no PII/secrets, explicit semver patch bump, Conventional Commits PR title (docs(work-items): …) — all satisfied.
No issues found. The PR is correct, complete, and aligned with the repo guidelines.
|
Claude finished @kyle-sexton's task in 1m 4s —— View job Security Review — PR #1340 (head
|
| File | Change |
|---|---|
plugins/work-items/.claude-plugin/plugin.json |
Semver patch bump 0.24.3 → 0.24.4 |
plugins/work-items/CHANGELOG.md |
Changelog entry for [0.24.4] |
plugins/work-items/tools/work-item-tracker/adapters/github/README.md |
New cross-cutting gotcha about UTF-8 body-edit safety |
Surfaces checked:
- Injection (command, path, template): The new gotcha adds code snippet examples in prose:
open(path, encoding='utf-8'),open(path, 'rb').read().decode('utf-8'),open(path, 'w', encoding='utf-8'),Get-Content -Raw -Encoding utf8, and[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false)). All are static documentation — none are executed at runtime by the plugin. The$p/$svariables in the PowerShellWriteAllTextsnippet are consumer-supplied variables in the ad-hoc write context the doc is advising on; there is no injection surface in a static prose example. - Token / secret / credential handling: None introduced or referenced.
- GitHub Actions patterns: No workflow files changed. No
pull_request_target,workflow_run,run:block script injection, permission widening, or new action references. - Supply-chain / dependency pins: No new dependencies, action references, or version pins added.
- Permission changes: None.
- File encoding integrity: The committed diff contains no BOM, no
\rbytes, and no mojibake sequences — consistent with the PR body's claimediconv/odverification. No permalink to the new content shows plain UTF-8 documentation prose. - External links: The single new external link (
https://peps.python.org/pep-0686/) points to the Python Software Foundation's canonical PEP index — no redirects or third-party trust delegation.
The guidance added reduces data-corruption risk for consumers doing out-of-pipeline body edits; it is a net positive for data integrity with no new attack surface.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e30e799aa4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @kyle-sexton's task in 1m 49s —— View job PR Review — #1340 (sync:
|
| Claim | Verdict |
|---|---|
gh transports pass encoding through untouched (no transcoding) |
✅ |
| Guarantee is encoding-safe, not byte-for-byte | ✅ |
$(cat …) strips trailing newlines; printf adds one back |
✅ |
| Corruption: UTF-8 read as ANSI, re-encoded, written back silently (exits 0) | ✅ |
| Em-dash U+2014 → U+00E2 U+20AC U+201D | ✅ |
Python open() no-encoding = ANSI code page through 3.14; PEP 686 flips default in 3.15 |
✅ |
open(path, 'rb').read().decode('utf-8') — binary mode, bytes.decode() valid |
✅ |
open(path, 'w', encoding='utf-8') — write-side encoding |
✅ |
PYTHONUTF8=1 covers both read and write sides |
✅ |
PS 5.1 Get-Content defaults to ANSI; PS 6+ defaults to utf8NoBOM |
✅ |
Get-Content -Raw returns one multiline string vs string[] |
✅ |
PS 5.1 -Encoding utf8 prepends BOM; utf8NoBOM invalid in 5.1 |
✅ |
[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false)) — UTF-8 no BOM |
✅ |
PowerShell 6+ has both utf8 (BOM) and utf8NoBOM |
✅ |
Metadata
plugin.json version 0.24.4; CHANGELOG.md [0.24.4] entry uses the repo-local Documentation heading, matches the prior [0.24.3] format, and references #1037. Consistent.
Repo guidelines
No hardcoded paths, no PII/secrets, explicit semver patch bump, Conventional Commits PR title (docs(work-items): …) — all satisfied. Four-commit resolution history (binary-mode decode → Get-Content -Raw + Python write-side → encoding-scope correction) is clean and fully addressed.
No issues found.
|
Claude finished @kyle-sexton's task in 1m 45s —— View job Security Review — PR #1340 (head
|
| File | Change |
|---|---|
plugins/work-items/.claude-plugin/plugin.json |
Semver patch bump 0.24.3 → 0.24.4 |
plugins/work-items/CHANGELOG.md |
Changelog entry for [0.24.4] |
plugins/work-items/tools/work-item-tracker/adapters/github/README.md |
New cross-cutting gotcha about UTF-8 body-edit safety (lines 326–346) |
Surfaces checked:
- Injection (command, path, template): The new gotcha adds code snippet examples in prose:
open(path, encoding='utf-8'),open(path, 'rb').read().decode('utf-8'),open(path, 'w', encoding='utf-8'),Get-Content -Raw -Encoding utf8, and[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false)). All are static documentation — none are executed at runtime by the plugin. The$p/$svariables in the PowerShellWriteAllTextsnippet are consumer-supplied variables in the ad-hoc write context the doc is advising on; there is no injection surface in a static prose example. - Token / secret / credential handling: None introduced or referenced.
- GitHub Actions patterns: No workflow files changed. No
pull_request_target,workflow_run,run:block script injection, permission widening, or new action references. - Supply-chain / dependency pins: No new dependencies, action references, or version pins added.
- Permission changes: None.
- File encoding integrity: The committed diff contains no BOM, no
\rbytes, and no mojibake sequences — consistent with the PR body's claimediconv/odverification. The[README.md permalink](https://github.com/melodic-software/claude-code-plugins/blob/80bc46fd9699ccd0da7fb28dfa57d8181ae704e0/plugins/work-items/tools/work-item-tracker/adapters/github/README.md#L326)to the new content confirms plain UTF-8 documentation prose. - External links: The single new external link (
https://peps.python.org/pep-0686/) points to the Python Software Foundation's canonical PEP index — no redirects or third-party trust delegation.
The guidance added reduces data-corruption risk for consumers doing out-of-pipeline body edits; it is a net positive for data integrity with no new attack surface.
Closes #1037
Summary
The GitHub adapter documents read-modify-write shapes that fetch an issue/comment body, edit it,
and write it back. #1037 filed those as a corruption vector: em-dashes (U+2014) coming back as
U+00E2 U+20AC U+201D, silently, with every command exiting 0.The issue's own investigation comment disproved the filed diagnosis, and this PR ships the
corrected convention rather than the one the issue body suggests. Both halves were re-verified
empirically on this machine before writing (see Test plan):
ghtransports are byte-faithful.--json/--jq,gh api, the bash>redirect, and--body-fileonly move bytes. A real em-dash pushed through a full comment round-trip(
-F body=@file->--jq '.body' > file->-F body=@file-> refetch) came back byte-identicalto the source. The pipelines in the adapter README need no encoding flag and are unchanged.
a tool whose default is a legacy code page — the body's UTF-8 read as Windows ANSI and re-encoded,
then written back over the good copy.
So the new gotcha is transport-agnostic: keep body edits inside the byte-faithful pipeline, and
where an ad-hoc step is unavoidable, state the encoding on both sides of it.
Two Windows defaults decode this way, both named with their version scope so the note does not rot:
open(), noencoding=encoding='utf-8',.decode('utf-8'), orPYTHONUTF8=1Get-Content-Encoding utf8PEP 686 (Final, Python 3.15) flips the Python default to UTF-8,
and PowerShell 6+ already defaults to
utf8NoBOM— which is exactly why the guidance is "state itexplicitly" rather than "check your version".
The write half is version-split deliberately. On Windows PowerShell 5.1,
Set-Content -Encoding utf8prepends a BOM and
utf8NoBOMdoes not exist as a value — and by the byte-faithfulness establishedabove,
--body-filewould carry thatU+FEFFstraight into the stored body. That path gets[IO.File]::WriteAllText($p, $s, (New-Object Text.UTF8Encoding $false))instead. This was a reviewfinding on the first draft of this PR, caught and verified before it shipped.
No behavior change: documentation plus the version/CHANGELOG bump the repo's parity gate requires.
No committed code in this repo instantiates the footgun — every
--body-fileread-modify-write hereis bash/jq with no decode step, which the diff asserts rather than assumes.
Test plan
Every claim in the new gotcha was reproduced on this machine (Windows 11, Git Bash,
gh2.95.0,Python 3.14.6 with
locale.getencoding()->cp1252, pwsh 7.6.3, Windows PowerShell 5.1.26100),byte-inspected with
od -tx1rather than eyeballed:e2 80 94read with Python's defaultopen()andre-encoded ->
c3 a2 e2 82 ac e2 80 9d— the exact byte sequence tooling: gh CLI --json/--jq body fetch + bash redirect silently mojibake-corrupts UTF-8 em-dashes on write-back (durable tracker content at risk) #1037 documents. Clean underencoding='utf-8', under.decode('utf-8'), and underPYTHONUTF8=1.Get-Content(no-Encoding) reproduced thesame mojibake; pwsh 7.6.3 was clean by default. This is why the note is version-scoped instead of
blanket "PowerShell corrupts".
Set-Content -Encoding utf8emittedef bb bf ...;utf8NoBOMwasrejected outright (not a valid enum value in 5.1);
WriteAllTextwithUTF8Encoding $falsewasclean. Confirms the version-split remedy above.
em-dash via
-F body=@file, fetched it back through the accused path(
gh api ... --jq '.body' > file), wrote it back via-F body=@file, and refetched: 1 em-dash,0 mojibake, byte-identical to source (
md5match after trailing-newline normalization). Thescratch comment was tombstoned afterward.
checked directly, not by inspection: 0 mojibake sequences, 0 CR bytes, no BOM, valid UTF-8
(
iconv -f UTF-8 -t UTF-8) in the git index.markdownlint-cli20 issues,typosexit 0,editorconfig-checkerexit 0,
check-changelog-parity.sh --checkand--check-bump origin/mainboth exit 0.Related
(Final, Python 3.15),
locale.getencoding()("On Windows, return the ANSI code page"),
Get-Content5.1(default
Default= active code page) vsGet-Content7.x(default
utf8NoBOM), andgh issue editfor--body-file.using
json.load(open(path)), which is itself the footgun on Windows). The correction lives inthat issue's investigation comment and now in the adapter README; the body is left as filed since
the thread supersedes it.
This PR was authored by AI (autonomous work-loop lane).