HS-plan: note sx pretty-print cherry-pick footgun + surgical re-apply workaround

This commit is contained in:
2026-04-24 11:04:06 +00:00
parent 5875c97391
commit f14a257533

View File

@@ -45,6 +45,8 @@ Orchestrator cherry-picks worktree commits onto `architecture` one at a time; re
**Good candidates to parallelise:** clusters that touch disjoint surfaces — e.g. 26 (resize observer) and 27 (intersection observer) edit the same mock file but different class stubs; 25 (parenthesised commands) is parser-only; 30 (logAll config) is bootstrap/integration-only. Avoid fanning out clusters that all rewrite the same dispatch spot (`emit-set`, `parse-expr`) in the same commit.
**Cherry-pick footgun (observed 2026-04-24):** `sx-tree`'s pretty-printer reformats large regions when an edit lands in the middle of a big `let`/`fn` body. Two worktree commits whose logical diffs touch *different* defines in the same `.sx` file will still conflict textually because the pretty-print shuffles comments and indentation. Because `.sx` files can't be `Edit`-ed (hook blocks `Edit`/`Write`), conflict markers left by git are unrepairable. **Workaround:** when you see a conflict, abort the cherry-pick and re-apply the worktree commit surgically via `sx_replace_node`/`sx_insert_near` on the specific paths that changed. The logical diff is usually small (510 nodes); read it with `git show SHA file.sx` and apply it as a series of tree edits on top of current HEAD.
### Bucket A: runtime fixes, single-file (low risk, high yield)
1. **[done (+4)] fetch JSON unwrap** — `hs-upstream-fetch` 4 tests (`can do a simple fetch w/ json` + 3 variants) got `{:__host_handle N}`. Root: `hs-fetch` in `runtime.sx` returns raw host Response object instead of parsing JSON body. Fix: when format is `"json"`, unwrap via `host-get "_json"` and `json-parse`. Expected: +4.