Skip to content

fix(desktop): align exported XML formatting whitespace - #9020

Merged
morluto merged 5 commits into
morluto:mainfrom
xu91102:codex/desktop-xml-whitespace
Nov 6, 2026
Merged

morluto merged 5 commits into
morluto:mainfrom
xu91102:codex/desktop-xml-whitespace

Conversation

@xu91102

@xu91102 xu91102 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #9012. Keep exported XML task checks consistent with REA's formatting-whitespace rule, so an unchanged final XML file receives the same result.

Problem and change

JavaScript trim() and Python's default strip() classify different characters. After a child element, the generated reader drops U+0085 data and retains U+FEFF formatting; the accepted XML tasks then fail in the exported verifier. U+FEFF here is inside the element, not a file-header BOM.

Main c363f3e moved XML reading to the canonical shared expat reader. Preserve that reader and migrate the fix to its existing _XmlReader._end predicate using a private class whitespace constant. The generic producer remains byte-for-byte main; the obsolete ElementTree implementation and old global constant are removed. No additional module global or app-class-name admission change is introduced: both the actual exported name inventory and Python top-level bindings remain identical to main.

The complete current main namespace/lexical-name handling, CDATA splitting, comments/PI counting, node/depth limits, leaf text and xml:space behavior remain. Main's seed/end selection, hostless bundles, archives and other formats retain their owners. Net change against c363f3e: 3 paths, 66 additions / 1 deletion: XML reader, original four regressions and owning documentation.

Contract and boundary impact

  • Owner: the generated XML reader's existing formatting predicate. Task equality, pointer/selector resolution and Evidence identity remain unchanged.
  • Scope: ordinary correctness repair within existing behavior; no new parser, namespace capability, provider, schema, dependency or target-execution authority.
  • CLI/MCP/catalog/install interfaces: unchanged by this contribution. Already-merged main capabilities remain canonical.
  • Resource limits, file identity, partial views and cleanup ownership: unchanged.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Reproduction and regression evidence

Issue #9012 preceded implementation. The original fe677f6 RED remains historical. On byte-exact current main production owners, the same original regression file produces 3 failures / 1 pass, while main's six namespace/CDATA/archive/budget controls pass (3 failed / 7 passed combined).

Nine actual public CLI calls before the fix (six inspect/task, three exports) reproduce the mismatch. Nine after the fix use the same original XML/capture/task bytes. The unmodified generated reader/evaluator occurs verbatim in actual exports and is executed with standard-library imports; all before-state controls remain false, all final checks become true, and full views agree with REA:

Final text after an element REA Before exported check Fixed exported check
U+0085, value_equals true false true
internal U+FEFF, value_absent true false true
ordinary text control true true true

Raw XML and retained capture/task hashes remain unchanged. The service framework was neither started nor mocked. Main's Inkscape/Writer fixtures are regression data, not a claim that those live GUI applications ran. Related #8994 documented this known gap and left default strip() in its producing code; relevant #8988 hunks also left it unchanged. No foreign runtime, first-discovery or source-credit claim is borrowed.

Validation performed

  • Fresh complete 14-file focused group: 198 passed; separate fresh README consistency: 9 passed. 15 distinct files, 207 passed, 0 skipped. Earlier 203, RED controls, runtime calls and reviewer probes are not added.
  • npm run check: passed, zero errors; existing advisory warnings remain.
  • npm run docs:check: passed.
  • npm run verify:test-discovery: all 3,120 files discovered exactly once.
  • npm pack --dry-run --json: passed. All 2,883 current published-file bytes match before/after normal hooks and fork push; no installed/archive/updater-equivalence claim.
  • Isolated Standards and Spec reviews: both passed on the same frozen source. Full source/index/gitlinks/patch/evidence/product-byte gates passed after normal hooks before push and again after push.

Current CI and review scope

Current head: 13874d6dea4948aa9fcf1a925f87639042f5889f, normal merge parents e3a3b3c + c363f3e. New-head CI42151206215, attempt 1, passed: 40 jobs, 17 successful and 23 conditionally skipped.

The complete 6,800,670-byte log was read. Every executed job checked out synthetic merge 90878a0, whose parents are CI base de8b2f3 and this exact feature head. CI base de8b2f3 is distinct from the feature's actually integrated c363f3e; it does not migrate the local validation to newer main.

Source tests: 24,135 passed / 16 skipped. Source plus eight built shards yields the Portable summary 42,088 passed / 271 skipped; Portable is not an additional execution, and local 207 is not added. All 15 previously focused files executed in their respective jobs. The four XML regressions ran in Linux built shard 5; main's six namespace/CDATA/archive/budget controls ran in Linux built shard 7. Linux x64 native package baseline ran (4 passed / 1 skipped), and Windows controls cross-compiled on Ubuntu. Windows/Apple runtime and provider lanes, including the dedicated Python-producer lane, were conditionally skipped; those skips are not platform passes or evidence of a full GUI/installed-provider flow. Earlier e3a3b3c CI is historical only.

A complete Codex review matching this new head is not yet established, and the last complete review read has no new concrete unresolved finding. The old 53ca44e opening-time usage notice explains only that old attempt. Local reviews, Greptile, CI and declaration guards do not establish Codex, security, human or maintainer approval.

Not run: full local deterministic suite (CI-owned), full GUI/Docker/agentenv service/live desktop applications, real Frida/native engines/agent/model, other hosts, installed-package/updater equivalence or performance measurements. No performance improvement is claimed.

Author readiness

Human owner: @xu91102

Recorded under the owner's explicit instruction for this new three-PR batch; automated checks do not establish human review or maintainer approval.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-05T12:01:38.651877Z
We couldn’t complete this review. Comment @codex review to try again.
53ca44e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR aligns exported Python XML views with REA’s existing whitespace rule.

  • Exported task checks now read XML formatting like REA does.

Reviews (5) · Last reviewed commit: "fix(desktop): retain XML whitespace chec..." · Reviewed by Greptile

@morluto
morluto merged commit d774422 into morluto:main Nov 6, 2026
49 checks passed
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
- main's morluto#9020 aligned the Python XML reader with TypeScript's old trim()
  set. This branch's TypeScript reader treats only XML whitespace as
  formatting and keeps text in mixed content, so the Python reader keeps
  this branch's rule. main's parity tests pass against it. main's parity
  test now expects a plain DOCTYPE to read, as this branch makes both
  readers do, and still refuses an unbound prefix.
- main's morluto#8999 nullable SQLite row identity keeps its imports in
  appTaskDraft.ts. Its other imports served code this branch moved out of
  the module. Both sides' new draft tests are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Exported XML task checks disagree on U+0085 and U+FEFF whitespace

2 participants