Repository navigation
fix(orch): read gates and standing orders containing Unicode line separators - #829
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
orch gate parkandorch standing addonly fold\nand\rout of their text, but the readers parse each line with regexes whose.does not match the other JavaScript line terminators, U+2028 and U+2029. Text pasted from a web page, PDF, or model output can contain these characters. The write succeeds, but every later read of the file then throws. One gate question with U+2028 makesgates.mdreport "has a malformed gate", which breaksgate list,gate park,gate resolve, andorch statusuntil someone edits the file by hand. The same thing in a standing order breaksstanding showandstanding addwith "malformed numbering". When a unit state contains one,orch statuscannot read back its previous summary comment and reports "first render" on every run.The gate field, standing-order, and status-summary patterns now use the
sflag, so.matches the entire value. Each file is still split on\nfirst, so line-based parsing works as before, and stores already damaged this way read correctly again. The Claude Code harness copy is regenerated.Validation: added "reads back gates, standing orders, and status containing Unicode line separators" to
orch/orch.test.ts. On origin/main it fails with "gates.md has a malformed gate release". With only the gate and standing fixes it still fails because the second status render reports "first render". With the full fix,bun test --timeout 900000 orchgives 22 pass and 0 fail. Also rannpm install --no-save ajv ajv-formats && node scripts/validate-plugins.mjs && node scripts/generate-pstack-harness-trees.mjs --check && node --test pstack/skills/*/scripts/test/*.test.mjs(57 pass, 0 fail, 93 skipped without TLC) andgit diff --check.Note
Low Risk
Localized parser regex changes for edge-case Unicode; behavior for normal
\n/\rtext is unchanged, with new regression coverage.Overview
Fixes orch store read paths that broke when pasted text contained JavaScript Unicode line terminators (U+2028 / U+2029). Writers already accepted that text, but parsers used
.without thesflag, sogates.md,preferences.md, and thestatus.mdsummary comment could fail on read and block gate/standing/status commands until manual edits.store.tsadds thesflag to the gate field, standing-order line, and<!-- orch-summary ... -->regexes so captured values include those characters. Line splitting on\nis unchanged.orch.test.tsadds a test that parks a gate and standing order with U+2028/U+2029, sets a unit state with U+2028, and asserts round-trip list/show and stable statuschanged(not"first render"every time).Reviewed by Cursor Bugbot for commit 86a56e6. Bugbot is set up for automated code reviews on this repo. Configure here.