Skip to content

chore: scripts audit - #34

Merged
bakirgdev merged 1 commit into
mainfrom
chore/scripts-audit
Oct 18, 2026
Merged

bakirgdev merged 1 commit into
mainfrom
chore/scripts-audit

Conversation

@bakirgdev

Copy link
Copy Markdown
Owner

An audit of scripts/: fewer scripts, less duplicated code, failures that say what went wrong, harnesses that clean up after themselves, and shellcheck in CI.

Changes

  • verify-contrast.sh merged into verify-design.sh as its contrast phase. One token and color parser now serves both checks; the second copy of the awk is gone. A new check: every expected ratio must also appear in the Contrast section of design/colors.md, so the doc and the script's table cannot drift apart unnoticed.
  • verify-share-sim.sh merged into verify-app-sim.sh: one build and install, then two scenarios (SIM-INTEROP-OK, SHARE-SIM-OK), the same shape as verify-app-mac.sh.
  • lib.sh gains logged LOG CMD.... Every xcodebuild step uses it (9 call sites across 5 scripts). Before, a failed build in the verify-* harnesses exited under set -e without a message. The build scripts call xcodebuild -project app/CrocApp.xcodeproj instead of cd app.
  • verify-app-mac.sh:
    • Every failure prints a FAIL: line. This fixes the known issue about a CLI receive failing silently.
    • An EXIT trap restores the pasteboard and removes the ~/Downloads/CrocApp file and every file the run leaves in the app's Documents, on failure too.
    • The header now describes all 12 scenarios.
  • Every croc CLI send passes --disable-clipboard. croc copies each code to the pasteboard, so the harnesses overwrote the user's pasteboard. That also made the step-10 save in verify-app-mac.sh save a croc code instead of the user's content.
  • verify-interop.sh:
    • A CLI receiver joins only after croctest's EVENT code line plus 3 s. Before, it was a fixed 3 s from process start. This fixes the known receiver-first race.
    • CROC_V10 defaults to $(go env GOPATH)/bin/croc.
  • Sim harness waits for the boot to finish (simctl bootstatus -b) before installing.
  • CI:
    • A shellcheck job. It runs shellcheck 0.11, preinstalled on ubuntu-26.04, over scripts/*.sh, and is wired into changes and ci pass.
    • scripts/screenshots/*.swift joins the swift-format source set.
  • Docs:
    • New scripts/AGENTS.md with the conventions every script now follows.
    • Every reference to the two removed scripts is updated, and stale scenario counts are fixed.
    • The two fixed harness entries are removed from known-issues.md.

Verification (local, macOS)

  • shellcheck -x scripts/*.sh: clean.
  • scripts/format-swift.sh --lint: PASS.
  • scripts/verify-design.sh: OK, and --quiet prints nothing.
    • The merged contrast table matches the old script's output row for row under diff.
    • A changed token produces drift findings.
    • A changed ratio in colors.md produces the new finding.
  • RELAY=127.0.0.1:9309 scripts/verify-interop.sh against a local relay, as CI runs it: ALL INTEROP CHECKS PASSED (41 PASS lines).
  • scripts/verify-app-sim.sh: SIM-INTEROP-OK and SHARE-SIM-OK.
  • scripts/verify-app-mac.sh: all 12 MAC-*-OK markers, exit 0, the pasteboard hash unchanged across the run, and no files left in Documents.
  • Not run: build-appstore.sh and build-devid.sh (they sign, upload and notarize), capture-screenshots.sh (it takes over the display). Their only change is the logged/-project form, which the harness builds above exercise.
  • mawk is not installed locally; this PR's design checks job runs verify-design.sh under mawk on Ubuntu.

- Merge verify-contrast.sh into verify-design.sh as its contrast phase,
  sharing one token and color parser, and check that every expected ratio
  also appears in design/colors.md's Contrast section.
- Merge verify-share-sim.sh into verify-app-sim.sh: one build and install,
  two scenarios.
- lib.sh: add logged, used for every xcodebuild step, so a failed build names
  its log instead of exiting silently under set -e.
- verify-app-mac.sh: a FAIL line for every failure, and an EXIT trap that
  restores the pasteboard and removes everything the run wrote outside its
  temp dir.
- Pass --disable-clipboard to every croc CLI send, which otherwise copies its
  code over the user's pasteboard.
- verify-interop.sh: wait for croctest's EVENT code before a CLI receiver
  joins, instead of a fixed sleep; default CROC_V10 to $(go env GOPATH)/bin.
- Wait for the simulator to finish booting before installing.
- CI: a shellcheck job; scripts/screenshots joins the swift-format source set.
- Add scripts/AGENTS.md, and update the docs that described the old scripts.
@bakirgdev
bakirgdev merged commit 274c498 into main Oct 18, 2026
13 checks passed
@bakirgdev
bakirgdev deleted the chore/scripts-audit branch October 18, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant