perf(validation): run assurance gate DAG with bounded concurrency - #40
Open
cryptoxdog wants to merge 1 commit into
Open
perf(validation): run assurance gate DAG with bounded concurrency#40cryptoxdog wants to merge 1 commit into
cryptoxdog wants to merge 1 commit into
Conversation
The assurance CLI awaited each gate in a strict serial loop, so gates that share only an upstream dependency (typecheck, lint, test, manifest, claims all depend only on 'source') ran one-at-a-time. Add a pure, dependency-aware, bounded-concurrency scheduler (scripts/validation/core/gate-scheduler.ts) and run only gate.execute() concurrently; evidence writing and the run report stay serialized in gateOrder so validation/runs output is unchanged. Concurrency is capped by VALIDATION_CONCURRENCY (default min(4, cpus), never unbounded); VALIDATION_CONCURRENCY=1 reproduces the previous serial order. Dependency-blocked semantics are preserved. Benchmark (bench-scheduler.ts): ci-profile wall-clock 2786ms -> 1412ms (~1.97x). Adds 9 scheduler tests; full suite vitest 158/158; manifest regenerated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjcHn8jZErKo37ZJi6qybX
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Stacked PR — top of the stack
Stacked on #39 (register typecheck fix), which stacks on #38 → #37 → #36. Base is
claude/fix-register-test-types; this PR's diff shows only the scheduler change. Retarget tomainonce the stack lands.Problem
The assurance CLI (
scripts/validation/cli.ts) executed its gate DAG in a strict serialforloop. Gates that only share an upstream dependency —typecheck,lint,test,manifest,claimsall depend only onsource— ran one-at-a-time even though they are independent, so the heavytestgate blocked everything after it and wall-clock was left on the table.Solution
Add a pure, dependency-aware, bounded-concurrency scheduler (
scripts/validation/core/gate-scheduler.ts) and run onlygate.execute()concurrently. All evidence writing and the run report are assembled serially ingateOrder, sovalidation/runs/**output is byte-stable regardless of completion order. Dependency-blocked cascade semantics are unchanged.VALIDATION_CONCURRENCY(defaultmin(4, cpus), never unbounded).VALIDATION_CONCURRENCY=1reproduces the exact previous serial order — a built-in rollback lever.Evidence
scripts/validation/bench-scheduler.ts): ci-profile wall-clock 2786ms → 1412ms (~1.97×, 49% reduction), stable across runs;1412msequals the DAG critical path, confirming full overlap of the independent gates.cap=1serial-equivalence, rejection propagation); full suite vitest 158/158;eslint src/clean; manifest current.npm run typecheckgate is green on this branch (exit 0) since it stacks on Fix pre-existing typecheck failures in register tests (CLI-FND-002) #39.Notes
Only
gate.execute()is parallelized; the previous serial contract is a one-env-var fallback.command-runner.tsalready spawned async, so this loop was the sole serializer. Produced via theunthrottle-cli-pr-packskill (selected optionCLI-OPT-001).Generated by Claude Code