Repository navigation
fix(desktop): align exported XML formatting whitespace - #9020
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR aligns exported Python XML views with REA’s existing whitespace rule.
Reviews (5) · Last reviewed commit: "fix(desktop): retain XML whitespace chec..." · Reviewed by Greptile |
- 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]>
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 defaultstrip()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
c363f3emoved XML reading to the canonical shared expat reader. Preserve that reader and migrate the fix to its existing_XmlReader._endpredicate 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:spacebehavior remain. Main's seed/end selection, hostless bundles, archives and other formats retain their owners. Net change againstc363f3e: 3 paths, 66 additions / 1 deletion: XML reader, original four regressions and owning documentation.Contract and boundary impact
Expected effects:
Reproduction and regression evidence
Issue #9012 preceded implementation. The original
fe677f6RED 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:
value_equalsvalue_absentRaw 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
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.Current CI and review scope
Current head:
13874d6dea4948aa9fcf1a925f87639042f5889f, normal merge parentse3a3b3c+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 basede8b2f3and this exact feature head. CI basede8b2f3is distinct from the feature's actually integratedc363f3e; 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
e3a3b3cCI 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
53ca44eopening-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.
Before merge
type(scope): outcome.