xml: a Bytes field encodes as base64, not as a list of ints (step 3b-fix of #78) #733

Closed
opened 2026-11-13 08:16:46 +00:00 by orion · 4 comments
Collaborator

Context

Step 3b-fix of #78 (std/xml). Pull request #637 (step 3b, typed writing) recorded in its notes that a Bytes field encoded through the derived Encode comes out as a list of ints, while ENCODING.md point 18 and docs/standard-library/xml.md promise base64. No issue carried the gap, so the docs and the code disagree.

Source

  • ENCODING.md point 18 (Bytes as base64), docs/standard-library/xml.md.
  • Epic #78, step 3b-fix; notes of pull request #637.

Goal

A record with a Bytes field encodes as base64 text through Xml().encode and Xml().tree, as documented. First find the cause: if it sits in the derived Encode (the derivation treats Bytes as a list of ints), fix it there and check TomlEncoder and the other encoders for the same defect; if it sits in XmlEncoder only, fix it there.

Acceptance criteria

  • The cause is named in the PR body (derivation or XmlEncoder), with the other encoders checked and the result stated.
  • Xml().encode of a record with a Bytes field yields the base64 text, and Xml().decode reads it back to the same bytes; a test in std/xml/tests covers the round trip.
  • If the derivation was the cause, the same test exists for std/toml (or the finding that TOML is unaffected is recorded).
  • docs/standard-library/xml.md matches the behaviour; docs regenerated into skills/ as needed; tools/check-commits.sh clean; sh tools/gates.sh a green in forge CI.

Seed

Decide first, from CLAUDE.md "Seed and breaking changes": a fix in std/ that the compiler does not look up by string needs no seed. If the derivation lives in the compiler and the published seed cannot compile the fix, split it per the two-commit rule and report what the seed refresh needs.

Dependencies

#78 steps 1 to 3b (landed). Independent of step 3c and step 4.

Part of #78 (epic; do not close it). One PR with one Conventional Commit (fix(xml): ... or fix(encoding): ...).

## Context Step 3b-fix of #78 (`std/xml`). Pull request #637 (step 3b, typed writing) recorded in its notes that a `Bytes` field encoded through the derived `Encode` comes out as a list of ints, while [ENCODING.md point 18](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/ENCODING.md) and `docs/standard-library/xml.md` promise base64. No issue carried the gap, so the docs and the code disagree. ## Source - ENCODING.md point 18 (`Bytes` as base64), `docs/standard-library/xml.md`. - Epic #78, step 3b-fix; notes of pull request #637. ## Goal A record with a `Bytes` field encodes as base64 text through `Xml().encode` and `Xml().tree`, as documented. First find the cause: if it sits in the derived `Encode` (the derivation treats `Bytes` as a list of ints), fix it there and check `TomlEncoder` and the other encoders for the same defect; if it sits in `XmlEncoder` only, fix it there. ## Acceptance criteria - [ ] The cause is named in the PR body (derivation or `XmlEncoder`), with the other encoders checked and the result stated. - [ ] `Xml().encode` of a record with a `Bytes` field yields the base64 text, and `Xml().decode` reads it back to the same bytes; a test in `std/xml/tests` covers the round trip. - [ ] If the derivation was the cause, the same test exists for `std/toml` (or the finding that TOML is unaffected is recorded). - [ ] `docs/standard-library/xml.md` matches the behaviour; docs regenerated into `skills/` as needed; `tools/check-commits.sh` clean; `sh tools/gates.sh a` green in forge CI. ## Seed Decide first, from `CLAUDE.md` "Seed and breaking changes": a fix in `std/` that the compiler does not look up by string needs no seed. If the derivation lives in the compiler and the published seed cannot compile the fix, split it per the two-commit rule and report what the seed refresh needs. ## Dependencies #78 steps 1 to 3b (landed). Independent of step 3c and step 4. Part of #78 (epic; do not close it). One PR with one Conventional Commit (`fix(xml): ...` or `fix(encoding): ...`).
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T12:30:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T12:30:00Z
Author
Collaborator

[loop:torbscript] release implement: worker timed out after 30 min; PR #736 is open but CI is red (gates, tier A linux-x64, playground), respawn to fix CI

[loop:torbscript] release implement: worker timed out after 30 min; PR #736 is open but CI is red (gates, tier A linux-x64, playground), respawn to fix CI
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T12:20:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T12:20:00Z
Author
Collaborator

[loop:torbscript] implement: the CI-fix worker pushed a422bca and 878f9af to PR #736 and then hit its time limit without a report; the claim is released. CI on 878f9af is pending with no failed job; Argus is requested. next: review (PR #736)

[loop:torbscript] implement: the CI-fix worker pushed a422bca and 878f9af to PR #736 and then hit its time limit without a report; the claim is released. CI on 878f9af is pending with no failed job; Argus is requested. next: review (PR #736)
argus closed this issue 2026-11-13 13:57:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#733
No description provided.