Repository navigation
quest: plan the repository improvement audit's findings #6327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7ba4b7a
e021b32
80a8e55
3c5a760
b38f19d
af5beb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # [XS] Tooling tests gate every merge | ||
|
|
||
| ## Goal | ||
|
|
||
| Every merge-queue Check runs `just gh test`, the tests of the CI selector, | ||
| release, size, and benchmark tooling, so a change to the machinery that picks | ||
| coverage cannot merge without its own tests. Nightly keeps running it as part | ||
| of the full gate. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22 from the repository improvement audit: run it on every | ||
| Check rather than select it by path. The whole recipe took about 10 s locally | ||
| (about 3% of a median 5.5-minute queue entry), and path selection would let a | ||
| broken selector skip the very tests that catch it. | ||
|
|
||
| - The run that planned this found `gh test` red on `main`: | ||
| `sh/gh/setup.test.ts` expects Check to be the last step of its job, and | ||
| [moq-dev/moq#6155](https://github.com/moq-dev/moq/pull/6155) appended | ||
| "Upload build timings" after it. It stayed unnoticed because no PR runs the | ||
| suite. [moq-dev/moq#6325](https://github.com/moq-dev/moq/pull/6325) fixes | ||
| that fixture; land after it, or fix it here if it has not merged. | ||
| - Run it from the `gh` module's check in `sh/dispatch.sh` (or an always-selected | ||
| module) and add any tools it needs (`python3`) to that module's tool list. | ||
| - Update the recipe comment in `.github/justfile` and the `gh test` comment in | ||
| Nightly's gate matrix, which both say no pull request runs it. Keep it in | ||
| Nightly only if the full gate there does not already cover it. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # [S] Signals notify on every structural change | ||
|
|
||
| ## Goal | ||
|
|
||
| A `Signal` holding a plain object or array notifies whenever a `set` changes | ||
| its structure, including a renamed key with an `undefined` value | ||
| (`{left: undefined}` to `{right: undefined}`) and an array whose length | ||
| changes without enumerable entries (`Array(1)` to `Array(2)`). Class | ||
| instances keep identity equality and notification coalescing is unchanged. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22 from the repository improvement audit, which reproduced | ||
| both missed notifications against `isEqual` in `js/signals/src/index.ts`: it | ||
| compares enumerable key counts and values, but not key membership or array | ||
| length. | ||
|
|
||
| - Fix `isEqual`: compare array `length`, and require each key of one side to | ||
| be an own key of the other. | ||
| - Add a fast-check model-based test (fast-check is already used by | ||
| `js/json`'s snapshot properties): commands for subscribe, set (including the | ||
| cases above), microtask flush, unsubscribe, and close, checked against a | ||
| small reference model of which subscribers fire and when. It covers the | ||
| notification and lifetime contract generally, not only this bug. | ||
| - Out of scope: an immediately disposed `Signal.watch()` still runs its queued | ||
| initial callback. No consumer depends on either behavior, and changing it is | ||
| an API timing decision; leave it unless the model test shows a consumer | ||
| hazard. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # [XS] crates.io trusts the Rust release workflow | ||
|
|
||
| ## Goal | ||
|
|
||
| Condition: every crate that `release-rs.yml` publishes has a crates.io trusted | ||
| publisher for `moq-dev/moq`, workflow `release-rs.yml` (and its environment, | ||
| if the job uses one). This is a maintainer action in each crate's crates.io | ||
| settings and blocks | ||
| [Rust releases publish through OIDC](/quest/m2/release-rs-oidc.md). | ||
|
|
||
| Check: for each crate that release-plz publishes, its crates.io settings page | ||
| lists that configuration. Delete this quest once every crate has one. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22: the human step is split from the workflow change so it | ||
| stays visible as ready work. A crate that has never been published still needs | ||
| its first publish done by hand before it can have a trusted publisher; list any | ||
| such crate here. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # [S] Nightly fuzzing keeps its corpus | ||
|
|
||
| ## Goal | ||
|
|
||
| Each Nightly fuzz target starts from the corpus the previous run evolved, so | ||
| coverage found in one 300-second run compounds instead of being discarded | ||
| with the runner. A second run demonstrably loads the first run's discoveries. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22 from the repository improvement audit. Nightly runs twelve | ||
| targets for 300 s each on fresh hosted runners and uploads only crash | ||
| artifacts. `sh/rs/fuzz.sh` already keeps a writable | ||
| `rs/<crate>/fuzz/corpus/<target>` separate from generated seeds, so only the | ||
| workflow has to persist it. | ||
|
|
||
| - Store it in `actions/cache`: restore by a per-target key prefix, then save | ||
| under a run-unique key after the run. Nightly runs daily, so the 7-day | ||
| eviction never fires. Rejected: chaining artifacts between runs (needs | ||
| cross-run lookup) and committing to a branch (needs a writer job with push | ||
| credentials). | ||
| - Minimize with `cargo fuzz cmin` before saving, so the corpus stays bounded. | ||
| - Save only after a successful run; a crash input already reaches the | ||
| failure artifact. | ||
|
Comment on lines
+22
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Preserve the evolved corpus when a target fails. The plan saves only after a successful run. The failure path uploads crash artifacts, not the new non-crashing corpus. The next Nightly can therefore restore an older corpus and lose coverage found before the crash. Persist the non-crashing corpus on failure, or define a separate quarantine path for crash inputs. 🤖 Prompt for AI Agents |
||
| - Verify it: the second Nightly's log reports more initial corpus entries than | ||
| seeds alone (libFuzzer's `INITED` line), for at least one target. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # [M] Browser publishing paths under test | ||
|
|
||
| ## Goal | ||
|
|
||
| The interop media harness publishes from Firefox as well as Chromium, so the | ||
| production capture paths Chromium never takes run in CI: the worker | ||
| `MediaStreamTrackProcessor` and the video-element fallback. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22 from the repository improvement audit. The harness | ||
| (`test/interop/clients/js/media.ts`) always launches Chromium for the | ||
| publisher, and its capability probe requires a window-level | ||
| `MediaStreamTrackProcessor`. `js/publish/src/video/processor.ts` uses that | ||
| only on Chromium; elsewhere it spawns a capture worker and falls back to a | ||
| video element. | ||
|
|
||
| - Add a selectable publisher engine to the harness, and make the capability | ||
| probe check the path production would take (worker support, not the window | ||
| global). | ||
|
Comment on lines
+13
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -o pipefail
printf '%s\n' '--- diff ---'
git diff --no-ext-diff --unified=80 a13fd2866588b3377962f415a9ca2c59585dcb53 3c5a760fb8659954215cdf46709da4f68354f9a4 -- quest/m2/publish-firefox.md
printf '%s\n' '--- plan file ---'
nl -ba quest/m2/publish-firefox.md
printf '%s\n' '--- relevant symbols ---'
rg -n -F --glob '!node_modules/**' --glob '!target/**' -e 'MediaStreamTrackProcessor' -e 'requestVideoFrameCallback' -e 'capability probe' -e 'capabilities' -e 'video element' -e 'video-element' -e 'worker' js quest tests 2>/dev/null || test "$?" -eq 1Repository: moq-dev/moq Length of output: 44182 🏁 Script executed: set -o pipefail
printf '%s\n' '--- production support probe ---'
nl -ba js/publish/src/support/index.ts | sed -n '1,125p'
printf '%s\n' '--- production processor ---'
nl -ba js/publish/src/video/processor.ts | sed -n '1,55p;88,180p;218,260p'
printf '%s\n' '--- interop harness media references ---'
rg -n -F --glob '*.ts' -e 'MediaStreamTrackProcessor' -e 'requestVideoFrameCallback' -e 'support' -e 'publisher' -e 'engine' test/interop/clients/js test/interop 2>/dev/null || test "$?" -eq 1
printf '%s\n' '--- interop media file ---'
nl -ba test/interop/clients/js/media.ts 2>/dev/null || trueRepository: moq-dev/moq Length of output: 41849 🏁 Script executed: set -o pipefail
printf '%s\n' '--- production support probe ---'
nl -ba js/publish/src/support/index.ts | sed -n '1,125p'
printf '%s\n' '--- production processor ---'
nl -ba js/publish/src/video/processor.ts | sed -n '1,55p;88,180p;218,260p'
printf '%s\n' '--- interop files ---'
rg --files test/interop | sort
printf '%s\n' '--- interop capability references ---'
rg -n -F --glob '*.ts' -e 'MediaStreamTrackProcessor' -e 'requestVideoFrameCallback' -e 'capability' -e 'publisher' -e 'engine' test/interop 2>/dev/null || test "$?" -eq 1Repository: moq-dev/moq Length of output: 28517 🏁 Script executed: set -o pipefail
printf '%s\n' '--- capability model ---'
nl -ba test/interop/clients/js/src/capabilities.ts
printf '%s\n' '--- harness capability gate ---'
nl -ba test/interop/clients/js/media.ts | sed -n '385,475p'
printf '%s\n' '--- publisher launch and capture ---'
nl -ba test/interop/clients/js/media.ts | sed -n '440,535p'Repository: moq-dev/moq Length of output: 11940 Do not let the worker requirement suppress fallback coverage. The harness capability probe must distinguish native window or worker capture, the video-element fallback, and unsupported capture. A browser with no worker capture but with Suggested plan update- Add a selectable publisher engine to the harness, and make the capability
- probe check the path production would take (worker support, not the window
- global).
+ Add a selectable publisher engine to the harness. Make the capability probe
+ distinguish native window or worker capture, the video-element fallback, and
+ unsupported capture. Do not gate the forced fallback case on worker support.🤖 Prompt for AI Agents |
||
| - Cover the worker path end to end in Firefox: frame transfer, source | ||
| replacement, cancellation with a read pending, and that every `VideoFrame` | ||
| is closed. | ||
| - Cover the video-element fallback by forcing it (for example, a worker | ||
| refused by CSP), in either engine. | ||
|
Comment on lines
+24
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Do not rely on a blob-worker CSP failure alone. The worker setup can switch to a hosted worker when a 🤖 Prompt for AI Agents |
||
| - Firefox only, on Linux. Playwright WebKit and a macOS Safari lane stay with | ||
| the m3 Safari work; Playwright's WebKit is not Safari. | ||
| - The test-runner option is the only interface change; document it in | ||
| `test/interop/README.md`. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Safari WebTransport](/quest/m3/safari-webtransport.md) - the later Safari lane | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # [S] Rust releases publish through OIDC | ||
|
|
||
| ## Goal | ||
|
|
||
| `release-rs.yml` publishes crates with crates.io trusted publishing through | ||
| release-plz's native OIDC support, and the long-lived `CARGO_REGISTRY_TOKEN` | ||
| secret is removed and revoked. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-10-22 from the repository improvement audit. release-plz (0.3.172 | ||
| in the dev shell) exchanges the GitHub OIDC token itself, so no separate | ||
| authentication Action is needed. | ||
|
|
||
| - Grant the publishing job `id-token: write` and drop `CARGO_REGISTRY_TOKEN` | ||
| from its environment. Keep the existing release guards. A job-level | ||
| `permissions` block replaces the workflow's `contents: write` and | ||
| `pull-requests: write`, which release-plz needs for tags, releases, and | ||
| PRs, so add `id-token: write` beside them or repeat all three. | ||
| - Verify on the next approved release that every crate published, then delete | ||
| the repository secret and revoke the token on crates.io. | ||
| - This removes a reusable credential; it does not protect against a | ||
| compromised authorized workflow. | ||
|
|
||
| ## Required | ||
|
|
||
| - [crates.io trusts the workflow](/quest/m2/crates-trusted-publisher.md) - every published crate has the trusted publisher configured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Define cache eviction and restore-miss handling.
The plan creates a new cache key for each target on each nightly run. GitHub Actions can evict these caches by least-recently-used order when the repository cache limit is reached, so the seven-day schedule does not guarantee corpus retention. Define a size and eviction policy, and report restore misses instead of silently restarting from seeds.
🤖 Prompt for AI Agents