orca/config
Hyeonho Lee (Ethan) 850342a3e0
fix(ci): run the root-directory guard on stock macOS bash 3.2 (#12879)
* fix(ci): run the root-directory guard on stock macOS bash 3.2

The guard script builds its base-tree lookup with `declare -A`, which
needs bash 4+. Its test spawns plain `bash` from PATH, and stock macOS
has shipped /bin/bash 3.2 since 2007, so on any Mac without a Homebrew
bash the script exits 2 before asserting anything and the default
`pnpm test` suite fails 3 of the guard's 4 cases. Machines with a
Homebrew bash on PATH never see it, which is why it went unnoticed.

Replace the associative array with a plain-array linear scan. Root
directories number in the dozens, so the O(n^2) membership check is
negligible, and the NUL-delimited reads that protect unusual filenames
stay as they were. The empty-array expansion is guarded for
`set -u` under bash 3.2.

All four guard tests now pass with /bin/bash 3.2; behavior under CI's
bash 5 is unchanged.

* fix(ci): run the root-directory guard under node instead of bash

The guard is the only check in the repo written in shell, and it used
`declare -A`, which stock macOS `/bin/bash` 3.2 does not have — so the
guard's own test suite failed 3 of 4 cases on any Mac without a Homebrew
bash. CI never noticed because runners ship bash 5.

Porting it to node removes the interpreter-version variable instead of
working around one construct: node is what the sibling script in this
directory already uses, it is the runtime that runs the test, and the
NUL-delimited read is the same shape as check-changed-code-quality.mjs.
It also drops a latent false pass — a failing `git ls-tree` inside the
shell's `< <(...)` was not caught by `pipefail`, so the read loop saw
nothing and the guard reported success. `execFileSync` throws instead,
which is why the two `git rev-parse --verify` probes are no longer
needed.

Output and exit codes are otherwise unchanged; the usage line now prints
node's script path where the shell printed `$0`.

Tests pin each guarantee and fail when it is reverted: NUL-delimited
reads so odd paths are reported unmangled, exit 2 on bad usage, and
git's own 128 with no node stack trace when a sha does not resolve.

* fix(ci): keep root entry bytes intact and fence guard output

git pathnames are arbitrary bytes, but the guard read ls-tree with
encoding 'utf8', so every invalid sequence collapsed to U+FFFD. That
mangled the reported name and, because the replacement is not
injective, let two different entries compare equal — a genuinely new
root entry could be waved through as pre-existing. Read the bytes as
latin1 and write them back unchanged.

The blocked-entry list is also attacker-controlled and went straight to
stdout. The runner trims leading whitespace before matching '::', so an
indented entry name still parses as a workflow command, and a pathname
may embed a newline. Wrap the list in ::stop-commands:: with a random
resume token so only the guard's own annotation is acted on.

---------

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-08-09 14:06:25 -07:00
..
build-plugins move folders (#12758) 2026-08-05 12:09:24 -07:00
docker/headless-pairing
nsis fix(windows): separate updater from orchestration migration (#11405) 2026-07-29 15:23:06 -07:00
oxlint-plugins perf(lint): consolidate code-quality gates into Oxlint (#11117) 2026-07-28 00:21:13 -07:00
patches Revert the terminal IME composition-ownership change (#13282) 2026-08-08 19:06:50 -07:00
relay-assets
scripts fix(ci): run the root-directory guard on stock macOS bash 3.2 (#12879) 2026-08-09 14:06:25 -07:00
dev-app-update.yml
electron-builder.config.cjs feat(updater): add an adhoc release channel for branch builds (#12051) 2026-08-02 01:46:51 -07:00
electron-vite-target.config.ts ci: parallelize PR checks and accelerate Vite builds (#10989) 2026-07-27 13:32:29 -07:00
i18n-translation-source.md docs(i18n): adopt gettext PO as the canonical translation source (#11478) 2026-07-31 11:46:25 -07:00
i18next.config.ts chore: declutter top-level repo layout (#11890) 2026-08-01 00:25:35 -07:00
knip.json move folders (#12758) 2026-08-05 12:09:24 -07:00
localization-audit.md docs(i18n): adopt gettext PO as the canonical translation source (#11478) 2026-07-31 11:46:25 -07:00
localization-coverage-allowlist.json fix(i18n): localize the status bar Resource Manager tooltip and remote-host count (#12478) 2026-08-06 19:14:15 -07:00
max-lines-baseline.txt chore(mobile): import the shared marine-creature corpus instead of mirroring it (#12090) 2026-08-02 01:44:03 -07:00
oxlint-code-quality-native-plugins.json perf(lint): consolidate code-quality gates into Oxlint (#11117) 2026-07-28 00:21:13 -07:00
oxlint-code-quality-type-aware.json perf(lint): consolidate code-quality gates into Oxlint (#11117) 2026-07-28 00:21:13 -07:00
oxlint-react-doctor.json chore(quality): ratchet Oxlint, React Doctor, and Zustand performance (#11034) 2026-07-27 18:58:36 -07:00
packaged-runtime-node-modules.cjs fix(packaging): prune non-target native binaries (#12174) 2026-08-03 10:54:00 -07:00
reliability-gates.jsonc Revert the terminal IME composition-ownership change (#13282) 2026-08-08 19:06:50 -07:00
tsconfig.cli.json fix(codex): recover interrupted state DB backfills (#12617) 2026-08-07 14:06:29 -07:00
tsconfig.node.json move folders (#12758) 2026-08-05 12:09:24 -07:00
tsconfig.relay.json
tsconfig.tc.cli.json
tsconfig.tc.web.json [P2] perf(windows): stop the capability poll respawning blocking wsl.exe probes (#11698) 2026-08-07 21:59:24 -07:00
tsconfig.web.json
vitest.config.ts test(env): keep happy-dom MutationObserver callbacks alive across GC (#12438) 2026-08-03 23:18:15 -07:00