[GH-ISSUE #1579] [Issue]: Catalog validation runs 48 steps serially; the catalog check itself is 5 s #1555

Closed
opened 2026-10-23 04:02:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1579

Originally assigned to: @SpicyMarinara, @Promansis on GitHub.

Summary

The required Catalog validation check takes about 3.3 minutes, of which the catalog validation itself is 5 seconds. The job runs 48 steps one after another on a 4-vCPU runner, and its three biggest steps (lint, typecheck, tests) are each single-threaded and serial. Running the independent work concurrently should bring the job to about 2 minutes.

Affected package

catalog/repository (CI: .github/workflows/pull-request-checks.yml, package.json scripts, scripts/typecheck-packages.mjs)

Expected behavior

The job uses the runner's cores: ESLint lints on several threads while Prettier runs alongside it, the seven package typechecks run at once, and the independent regression tests run concurrently, with each command's output kept together in the log.

Actual behavior

Medians over the last 12 successful runs (job median 199 s):

Time Step
58 s Check formatting and lint (npm run check: Prettier, then ESLint, one after the other)
36 s Checkout (fetch-depth: 0; needed, the artifact validation reads the zips)
28 s Check package source names (typecheck:packages: tsc for 7 packages, sequentially)
~49 s 38 test and validation steps, all sequential; the Pixelforge brief test alone is 20 s
~20 s Per-step start and stop overhead across the 48 steps
4 s npm ci
  • The lint globs cover 1,723 files (21 MB). Locally Prettier takes 26 s and ESLint 24 s on one thread; ESLint 10 supports --concurrency, and with 4 workers it takes 11 s. ESLint's rules take about 8 s; the rest is parsing.
  • scripts/typecheck-packages.mjs runs tsc once per package with execFileSync. Locally the seven runs take 31 s in total; the largest (slurp2) peaks at about 900 MB, so running all seven at once needs under 4 GB.
  • The test steps are independent of each other and write only to the system temp directory, so they can run concurrently.

After the CodeQL checkout fix (sparse checkout without artifacts/), this job becomes the slowest required check, so it sets the time to mergeable for every pull request.

Steps to reproduce

  1. Open any pull request into staging and open the Catalog validation job.
  2. Compare the step durations with the table above.

Environment

  • Marinara Engine version: n/a
  • Package version: n/a
  • Install type: other (GitHub Actions, ubuntu-latest, 4 vCPU)
  • OS + version: ubuntu-latest runner
  • Browser or app shell: n/a

Logs, screenshots, or video

Step durations were read from the Actions API (each run's /jobs endpoint).

Additional context

Minimal fix

  • package.json: lint gets --concurrency auto; check runs format:check and lint at the same time instead of &&.
  • scripts/typecheck-packages.mjs: run the packages concurrently with execFile instead of execFileSync, keeping each package's output together and the existing "Could not run tsc" failure when tsc cannot start (scripts/tests/typecheck-packages-missing-tsc.regression.mjs).
  • A small runner, scripts/run-parallel.mjs, that runs the commands it is given (arguments, or one per line on stdin) with up to one process per core, buffers each command's output and prints it as a log group when it finishes, runs every command even after a failure, and exits non-zero if any failed. check and the workflow's test step both use it.
  • .github/workflows/pull-request-checks.yml: the test steps between "Test package security invariants" and "Test owner approval evaluator" become one step that feeds the same commands, with their comments, to the runner. Checkout, npm ci, npm run check, the typecheck and the whitespace check stay as separate steps.

Expected effect: lint 58 → about 30 s (Prettier is the floor), typecheck 28 → about 10 s, tests about 49 s plus overhead → about 25 s (the Pixelforge test is the floor). Together about 3.3 → 2 min. These are estimates from a 12-core machine scaled to 4 vCPU; the first run on a pull request measures it.

Trade-off: a failing test is found in one step's log instead of a named red step. The runner keeps each command's output in its own group and marks failed commands with an error annotation.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1579 Originally assigned to: @SpicyMarinara, @Promansis on GitHub. ## Summary The required `Catalog validation` check takes about 3.3 minutes, of which the catalog validation itself is 5 seconds. The job runs 48 steps one after another on a 4-vCPU runner, and its three biggest steps (lint, typecheck, tests) are each single-threaded and serial. Running the independent work concurrently should bring the job to about 2 minutes. ## Affected package catalog/repository (CI: `.github/workflows/pull-request-checks.yml`, `package.json` scripts, `scripts/typecheck-packages.mjs`) ## Expected behavior The job uses the runner's cores: ESLint lints on several threads while Prettier runs alongside it, the seven package typechecks run at once, and the independent regression tests run concurrently, with each command's output kept together in the log. ## Actual behavior Medians over the last 12 successful runs (job median 199 s): | Time | Step | | --- | --- | | 58 s | Check formatting and lint (`npm run check`: Prettier, then ESLint, one after the other) | | 36 s | Checkout (`fetch-depth: 0`; needed, the artifact validation reads the zips) | | 28 s | Check package source names (`typecheck:packages`: `tsc` for 7 packages, sequentially) | | ~49 s | 38 test and validation steps, all sequential; the Pixelforge brief test alone is 20 s | | ~20 s | Per-step start and stop overhead across the 48 steps | | 4 s | `npm ci` | - The lint globs cover 1,723 files (21 MB). Locally Prettier takes 26 s and ESLint 24 s on one thread; ESLint 10 supports `--concurrency`, and with 4 workers it takes 11 s. ESLint's rules take about 8 s; the rest is parsing. - `scripts/typecheck-packages.mjs` runs `tsc` once per package with `execFileSync`. Locally the seven runs take 31 s in total; the largest (slurp2) peaks at about 900 MB, so running all seven at once needs under 4 GB. - The test steps are independent of each other and write only to the system temp directory, so they can run concurrently. After the CodeQL checkout fix (sparse checkout without `artifacts/`), this job becomes the slowest required check, so it sets the time to mergeable for every pull request. ## Steps to reproduce 1. Open any pull request into `staging` and open the `Catalog validation` job. 2. Compare the step durations with the table above. ## Environment - Marinara Engine version: n/a - Package version: n/a - Install type: other (GitHub Actions, `ubuntu-latest`, 4 vCPU) - OS + version: `ubuntu-latest` runner - Browser or app shell: n/a ## Logs, screenshots, or video Step durations were read from the Actions API (each run's `/jobs` endpoint). ## Additional context ### Minimal fix - `package.json`: `lint` gets `--concurrency auto`; `check` runs `format:check` and `lint` at the same time instead of `&&`. - `scripts/typecheck-packages.mjs`: run the packages concurrently with `execFile` instead of `execFileSync`, keeping each package's output together and the existing "Could not run tsc" failure when `tsc` cannot start (`scripts/tests/typecheck-packages-missing-tsc.regression.mjs`). - A small runner, `scripts/run-parallel.mjs`, that runs the commands it is given (arguments, or one per line on stdin) with up to one process per core, buffers each command's output and prints it as a log group when it finishes, runs every command even after a failure, and exits non-zero if any failed. `check` and the workflow's test step both use it. - `.github/workflows/pull-request-checks.yml`: the test steps between "Test package security invariants" and "Test owner approval evaluator" become one step that feeds the same commands, with their comments, to the runner. Checkout, `npm ci`, `npm run check`, the typecheck and the whitespace check stay as separate steps. Expected effect: lint 58 → about 30 s (Prettier is the floor), typecheck 28 → about 10 s, tests about 49 s plus overhead → about 25 s (the Pixelforge test is the floor). Together about 3.3 → 2 min. These are estimates from a 12-core machine scaled to 4 vCPU; the first run on a pull request measures it. Trade-off: a failing test is found in one step's log instead of a named red step. The runner keeps each command's output in its own group and marks failed commands with an error annotation. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1555
No description provided.