Skip to content

feat(cli): add -j and --jobs 0 for one process per core instead of an --async mode (#205) - #238

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/jobs-option
Oct 8, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/jobs-option

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Contract

ctrace deprecated its --async for -j/--jobs (CoreTrace/coretrace#158, 2026-10-01): tools run on one worker per core by default, --async is a deprecated spelling of that default, and ctrace runs this analyzer with --check --format sarif <root>, waiting for the result. Rather than adding an --async mode the orchestrator has just retired, the analyzer follows the same model:

  • -j N is --jobs N; --jobs 0 analyses in one process per core the process may run on (os.process_cpu_count), as runtime.jobs of ctrace; the default stays 1, so a run without the option is unchanged; a negative value is an error.
  • The command always waits for the complete report. Report, finding order, --fail-on, cache, baseline and SBOM/VEX do not depend on the number of processes; worker processes are bounded and cleaned up by the existing process pool.
  • There is no --async option, and no detached job.

engine.analyze_project keeps its jobs >= 1 contract; the command line resolves 0.

Verification

New tests in tests/test_jobs_option.py (red before the change): -j equals --jobs, -j 0 uses one process per core and yields the same report, the default stays one, negative values are rejected, --async does not exist, the help names -j and 0. No existing test changed. Full suite green on 3.14 (apart from the local test_packaging environment issue) and 3.11; ruff, mypy clean; regression snapshots unchanged; mitmproxy: -j 0 (8 cores) gives a report identical to -j 1.

Closes #205

@SizzleUnrlsd SizzleUnrlsd added the enhancement New feature or request label Oct 8, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Oct 8, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit aa0871d into main Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): define and implement --async analysis mode

1 participant