Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/design-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
permissions:
contents: read

# A new push to a pull request replaces that pull request's run; main's runs
# and other pull requests' runs are never cancelled.
concurrency:
group: design-contract-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
static-design:
runs-on: ubuntu-latest
Expand Down
271 changes: 184 additions & 87 deletions .github/workflows/pr.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/web-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The web end-to-end suite as one reusable lane, so the pull request's Linux
# shards, its macOS `@platform` job and all three nightly OS lanes build, fetch and
# shards, its macOS and Windows `@platform` jobs and all three nightly OS lanes build, fetch and
# run the suite the same way and differ only in what they are asked here: the
# runner, which Herdr asset to run, how many shards deal the tests out, and
# which tests (`grep` and `full-suite`) to keep.
Expand Down
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Use [docs/README.md](docs/README.md) to find current guides and distinguish hist

Run the same required lanes CI runs.
These are the local equivalents; the remote `verify` result still depends on the actual CI run.
CI runs the Rust suite, the unit suites, the invariant checks and the whole web end-to-end (six shards) on Linux, where the Herdr schema comparison and the web end-to-end use the pinned release's Linux asset, and keeps two jobs on macOS, the platform hide ships on: the Electron end-to-end and the web end-to-end's `@platform` tests.
CI's `plan` job picks the lanes a pull request needs from the paths it changes, and `verify` requires exactly those; a push to main runs every lane, and [docs/TESTING.md](docs/TESTING.md#which-lanes-a-pull-request-runs) owns the rules.
Across its lanes CI runs the Rust suite, the unit suites, the invariant checks and the whole web end-to-end (six shards) on Linux, where the Herdr schema comparison and the web end-to-end use the pinned release's Linux asset; two jobs on macOS, the platform hide ships on: the Electron end-to-end and the web end-to-end's `@platform` tests; and on Windows `windows check` (compile, daemon and unit suites) and `windows e2e` (the browser `@platform` tests).
`.github/workflows/pr.yml` says why; `nightly.yml` configures full web and desktop suites and package checks on Linux, macOS and Windows, with tracked flaky tests blocking the nightly result.
Read the executed jobs and their skips before claiming an OS is verified; a configured matrix is not execution evidence.

Expand All @@ -28,6 +29,7 @@ bash scripts/check-harness-ignore-anchor.sh
bash scripts/check-agent-asset-committed.sh
bash scripts/check-capability-readers-off-lock.sh
python3 -m unittest discover -s scripts/tests -p 'test_*.py'
python3 scripts/ci-plan.py plan --event pull_request --base origin/main --head HEAD # the lanes CI would plan, only when HEAD is a merge commit; otherwise it plans every lane
node --test scripts/tests/nightly-report.test.cjs
bash scripts/check-no-workstation-identity.sh
bash scripts/check-worktree-removal-boundary.sh
Expand Down Expand Up @@ -64,11 +66,13 @@ There is no label or bypass for any of them; when a gate is wrong, change the ga
| herdr pin single source | The Herdr version and digest live only in `herdr-bundle.json` | `zsh scripts/check-herdr-pin-single-source.sh` | Derive from the manifest; never restate the value. Bump with `scripts/bump-herdr.sh <version>`. |
| herdr schema contract | The binary schema equals `contracts/herdr-api.schema.json` after canonical JSON normalization and its version matches the manifest, on all three systems | `python3 scripts/check-herdr-schema.py --herdr-bin <pinned herdr>` | The schema moved with a Herdr release; update the contract and every call site it names, then the fixtures. |
| os contract | What differs between macOS, Linux and Windows behaves the same on all three, observed from the caller: the local stream under the Herdr client, owned children and what the kernel says about a pid, private files, locks, atomic replacement, links, file identity and disk space, folder watching (a change in two seconds, no change for a read, a bounded burst that ends in an overflow), where the account's things live, and the client and the default socket against the pinned Herdr for that system (the Windows zip runs only here) | `bash scripts/verify-cargo.sh test-scoped -p hide-platform -p hide-herdr-client`, then `HIDE_E2E_HERDR_BIN=<pinned herdr> bash scripts/verify-cargo.sh test-scoped -p hide-herdr-client --test real_herdr -- --ignored` | A contract failed on one system: fix the code under it, not the test; the Linux and Windows legs are `os-contract.yml`, the macOS leg runs in `desktop-e2e`. |
| windows check | The workspace compiles for Windows, and the daemon, app unit suites and browser `@platform` smoke hold there with their existing assertions: hided's pane bootstrap and end-to-end tests, `hide connect` starting the `hided.exe` beside it and `hide stop` ending it, the install kit's Windows command shim and junction, the agent hook entries run through PowerShell, hided driving the pinned Herdr, a real listening port attributed to its working directory with native read failures exposed, and checkout cleanup excluded when its live listener starts through another path spelling, the web and desktop unit suites, and the same browser platform tests as on macOS | On Windows: `bash scripts/verify-cargo.sh check --workspace --all-targets`, `bash scripts/verify-cargo.sh test-scoped -p hided --lib pane_auth`, `bash scripts/verify-cargo.sh test-scoped -p hided --test connect_stop`, `bash scripts/verify-cargo.sh test-scoped -p hided --test handshake`, `bash scripts/verify-cargo.sh test-scoped -p hide-kit`, `bash scripts/verify-cargo.sh test-scoped -p hide-agent-hooks`, `HIDE_E2E_HERDR_BIN=<pinned herdr.exe> bash scripts/verify-cargo.sh test-scoped -p hided --test real_herdr -- --ignored`, `bash scripts/verify-cargo.sh test-scoped -p herdr-core --lib ports::tests::a_real_listener_is_found_and_attributed_to_the_directory_it_runs_in -- --exact --nocapture`, `bash scripts/verify-cargo.sh test-scoped -p herdr-core --lib ports::tests::cleanup_keeps_a_checkout_in_use_when_a_listener_starts_through_another_spelling -- --exact --nocapture`, `bash scripts/verify-web.sh web typecheck`, `bash scripts/verify-web.sh web test`, `bash scripts/verify-web.sh desktop typecheck`, `bash scripts/verify-web.sh desktop test`, `bash scripts/verify-web.sh web build`, `bash scripts/verify-web.sh web playwright-install`, `HIDE_E2E_HERDR_BIN=<pinned herdr.exe> bash scripts/verify-web.sh web e2e --grep @platform` (local path tests need Developer Mode or an administrator for links) | A Windows-only failure must be fixed under the same assertion; a spec's POSIX assumption is a portability gap, not permission to skip the flow. Browser setup and unit checks can proceed after an earlier runtime failure, which still fails the required job. The job is in `pr.yml`. |
| windows check | The workspace compiles for Windows, and the daemon and app unit suites hold there with their existing assertions: hided's pane bootstrap and end-to-end tests, `hide connect` starting the `hided.exe` beside it and `hide stop` ending it, the install kit's Windows command shim and junction, the agent hook entries run through PowerShell, hided driving the pinned Herdr, a real listening port attributed to its working directory with native read failures exposed, and checkout cleanup excluded when its live listener starts through another path spelling, and the web and desktop unit suites | On Windows: `bash scripts/verify-cargo.sh check --workspace --all-targets`, `bash scripts/verify-cargo.sh test-scoped -p hided --lib pane_auth`, `bash scripts/verify-cargo.sh test-scoped -p hided --test connect_stop`, `bash scripts/verify-cargo.sh test-scoped -p hided --test handshake`, `bash scripts/verify-cargo.sh test-scoped -p hide-kit`, `bash scripts/verify-cargo.sh test-scoped -p hide-agent-hooks`, `HIDE_E2E_HERDR_BIN=<pinned herdr.exe> bash scripts/verify-cargo.sh test-scoped -p hided --test real_herdr -- --ignored`, `bash scripts/verify-cargo.sh test-scoped -p herdr-core --lib ports::tests::a_real_listener_is_found_and_attributed_to_the_directory_it_runs_in -- --exact --nocapture`, `bash scripts/verify-cargo.sh test-scoped -p herdr-core --lib ports::tests::cleanup_keeps_a_checkout_in_use_when_a_listener_starts_through_another_spelling -- --exact --nocapture`, `bash scripts/verify-web.sh web typecheck`, `bash scripts/verify-web.sh web test`, `bash scripts/verify-web.sh desktop typecheck`, `bash scripts/verify-web.sh desktop test` (local path tests need Developer Mode or an administrator for links) | A Windows-only failure must be fixed under the same assertion; a spec's POSIX assumption is a portability gap, not permission to skip the flow. Unit checks can proceed after an earlier runtime failure, which still fails the required job. The job is in `pr.yml`. |
| windows e2e | The same browser `@platform` tests as on macOS hold on Windows against hided and the pinned Herdr for Windows | On Windows: `bash scripts/verify-cargo.sh build -p hided`, `bash scripts/verify-web.sh web build`, `bash scripts/verify-web.sh web playwright-install`, `HIDE_E2E_HERDR_BIN=<pinned herdr.exe> bash scripts/verify-web.sh web e2e --grep @platform --grep-invert @flaky` | Fix it under the same assertion, as for `windows check`. It is `web-e2e.yml` called from `pr.yml` with the Windows runner, and runs when the plan names it. |
| lane plan | Each lane runs exactly when the plan needs it, and `verify` fails a planned lane that did not succeed or an unplanned one that ran | `python3 -m unittest discover -s scripts/tests -p 'test_ci_plan.py'` | A lane left out a change it needed: fix the rule in `scripts/ci-plan.py` and add the path to its test. |

The `@flaky` quarantine, and for a Rust OS contract test an `ignore` on the one system it fails on, is the only way a test leaves a required gate; [docs/TESTING.md](docs/TESTING.md#flaky-tests) owns when a test may be tagged and which lanes still run it.

A web e2e test that exercises what differs by operating system is tagged `{ tag: "@platform" }` with a comment saying what, and a pull request runs those on macOS and Windows as well as in the full Linux shards: Trash, process ownership, file watching and saving, worktree paths, disk cleanup, terminal input and echo through the platform's Herdr, and platform editing chords and browser-composed Korean input.
A web e2e test that exercises what differs by operating system is tagged `{ tag: "@platform" }` with a comment saying what, and a pull request whose plan includes the platform lanes runs those on macOS and Windows as well as in the full Linux shards: Trash, process ownership, file watching and saving, worktree paths, disk cleanup, terminal input and echo through the platform's Herdr, and platform editing chords and browser-composed Korean input.
Every web e2e presses its chords through `web/e2e/chords.ts`, which reads them from the shell's registry for the runner's system, so the Linux shards press the Ctrl+Shift and Alt+Shift chords Windows and Linux use and the macOS run presses the ⌘ ones; a spec spells a chord itself only when it binds one in Settings or presses one the shell must not answer.
The PR runs the remaining web tests on Linux.
The nightly configures the full web suite on Linux (six shards), macOS and Windows (four shards each), the full desktop suite on all three, per-OS schema/runtime contracts, and all three packages.
Expand Down
6 changes: 3 additions & 3 deletions docs/PERFORMANCE_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ This table describes the checked-in workflows, not a claim that a particular PR'

| Layer | What it catches | Current execution |
| --- | --- | --- |
| Deterministic regression tests and structural checks | Blank repaint buffers, cache bounds, incorrect state transitions, blocking work in forbidden paths | The Rust workspace suite and repository invariant checks run on every PR and main push in `.github/workflows/pr.yml`; `design-contract.yml` adds static design checks |
| Automated end-to-end | Real window launch, attach to a private Herdr server, IPC between the desktop host and `hided`, occluded-window rendering, packaging mistakes | Playwright drives the web shell in a browser and the desktop app through `desktop/e2e/fixture.ts`; the web suite runs in the six Linux `web-e2e` shards and, for its `@platform` tests, in one macOS job, the desktop app in the macOS `desktop-e2e` job of `pr.yml`, and `nightly.yml` configures full web and desktop suites on Linux, macOS and Windows, with tracked flaky tests blocking nightly; Linux desktop uses Xvfb; `verify` requires the pull request's jobs |
| Deterministic regression tests and structural checks | Blank repaint buffers, cache bounds, incorrect state transitions, blocking work in forbidden paths | The repository invariant checks run on every PR and main push in `.github/workflows/pr.yml`, and the Rust suite on every main push and on each PR whose plan includes it (docs/TESTING.md, "Which lanes a pull request runs"); `design-contract.yml` adds static design checks |
| Automated end-to-end | Real window launch, attach to a private Herdr server, IPC between the desktop host and `hided`, occluded-window rendering, packaging mistakes | Playwright drives the web shell in a browser and the desktop app through `desktop/e2e/fixture.ts`; the web suite runs in the six Linux `web-e2e` shards and, for its `@platform` tests, in one macOS job and one Windows job, the desktop app in the macOS `desktop-e2e` job of `pr.yml`, each when the pull request's plan includes it, and `nightly.yml` configures full web and desktop suites on Linux, macOS and Windows, with tracked flaky tests blocking nightly; Linux desktop uses Xvfb; `verify` requires the pull request's jobs |
| Controlled performance comparison | Warm/cold latency distributions, periodic stalls, CPU/lock contention, sustained RSS, and cost that grows with process uptime | Local matched baseline/candidate measurements (`scripts/web-shell-measure/run.sh`); no checked-in scheduled or required performance job |

The repository-invariant Python tests run in the required `checks` lane of `pr.yml`.
The repository-invariant Python tests run in the `policy` lane of `pr.yml`, which every plan includes.
Fixture/replay commands under `scripts/web-shell-measure/` do not become CI gates merely because this guide lists them.
Check the workflow before claiming any of them runs automatically.
The per-OS schema/runtime contracts and three package lanes are nightly configuration; actual executed jobs, failures and skips establish a particular head's coverage.
Expand Down
Loading
Loading