Complete and verify the Bun CI cutover #293

Open
opened 2026-10-17 02:35:38 +02:00 by nessar · 1 comment
Owner

What to build

The maintainer can rely on one reproducible Bun toolchain from
a clean checkout through required CI checks and the production container, with
evidence that no project-owned JavaScript step still falls back to Node.

Acceptance criteria

  • Complete project-owned policy and image-publisher invocation under Bun,
    including their regression scripts, child processes, executable fixtures,
    and CI entry points. Preserve their temporary-repository and fake-Docker
    tests so local verification performs no real registry writes.
  • Preserve policy/publisher outcomes for push, pull-request, fork, manual, and
    stable-release events. Runtime changes must not alter GitFlow, Conventional
    Commit enforcement, publication eligibility, or existing image promotion.
  • Audit every project command, child executable, CI step, container stage,
    and documented prerequisite. Use the same exact verified Bun release and
    frozen dependencies throughout; remove obsolete callers, configuration,
    and dependencies after confirming they have no remaining use.
  • Exercise the documented developer workflow, full native functional suite,
    coverage, lint, formatting, standalone type checks, Angular production
    build, benchmark protocol, and production container on the integrated
    branch. Demonstrate Bun execution with Node unavailable to project commands.
  • Preserve security scans, artifact retention and failure-path coverage
    uploads, required benchmark and publication dependencies, and the aggregate
    required check. Do not weaken tests, budgets, or gates to claim completion.
  • Verify any third-party Gitea action runtime requirement separately. Do not
    treat infrastructure-provided Node as permission to run project commands
    with it; surface unresolved infrastructure changes or exceptions.
  • Rebase the scoped feature integration branch onto current origin/develop
    before the PR to develop, and rerun affected checks if the base advances.
    Use the repository's required PR/maintainer integration process; do not push
    directly to protected branches or merge without authorization.
  • Obtain successful required Gitea checks on the final PR revision under the
    existing activation and publication process. Keep local evidence distinct
    from live CI results; missing credentials or activation evidence must be
    reported rather than bypassed or provisioned without authorization.
  • Hand off the verification results and any remaining blockers against the migration's
    published acceptance criteria. No native-tool incompatibility, missing required report,
    Node fallback, or unverified required gate may be described as complete.
    Do not change branch protections, create release tags, or deploy.

Blocked by

  • #290 — Run development and quality checks with Bun
  • #291 — Run all tests and benchmarks with Bun
  • #292 — Serve the deployed application with Bun
## What to build The maintainer can rely on one reproducible Bun toolchain from a clean checkout through required CI checks and the production container, with evidence that no project-owned JavaScript step still falls back to Node. ## Acceptance criteria - [ ] Complete project-owned policy and image-publisher invocation under Bun, including their regression scripts, child processes, executable fixtures, and CI entry points. Preserve their temporary-repository and fake-Docker tests so local verification performs no real registry writes. - [ ] Preserve policy/publisher outcomes for push, pull-request, fork, manual, and stable-release events. Runtime changes must not alter GitFlow, Conventional Commit enforcement, publication eligibility, or existing image promotion. - [ ] Audit every project command, child executable, CI step, container stage, and documented prerequisite. Use the same exact verified Bun release and frozen dependencies throughout; remove obsolete callers, configuration, and dependencies after confirming they have no remaining use. - [ ] Exercise the documented developer workflow, full native functional suite, coverage, lint, formatting, standalone type checks, Angular production build, benchmark protocol, and production container on the integrated branch. Demonstrate Bun execution with Node unavailable to project commands. - [ ] Preserve security scans, artifact retention and failure-path coverage uploads, required benchmark and publication dependencies, and the aggregate required check. Do not weaken tests, budgets, or gates to claim completion. - [ ] Verify any third-party Gitea action runtime requirement separately. Do not treat infrastructure-provided Node as permission to run project commands with it; surface unresolved infrastructure changes or exceptions. - [ ] Rebase the scoped feature integration branch onto current `origin/develop` before the PR to `develop`, and rerun affected checks if the base advances. Use the repository's required PR/maintainer integration process; do not push directly to protected branches or merge without authorization. - [ ] Obtain successful required Gitea checks on the final PR revision under the existing activation and publication process. Keep local evidence distinct from live CI results; missing credentials or activation evidence must be reported rather than bypassed or provisioned without authorization. - [ ] Hand off the verification results and any remaining blockers against the migration's published acceptance criteria. No native-tool incompatibility, missing required report, Node fallback, or unverified required gate may be described as complete. Do not change branch protections, create release tags, or deploy. ## Blocked by - #290 — Run development and quality checks with Bun - #291 — Run all tests and benchmarks with Bun - #292 — Serve the deployed application with Bun
nessar added the ready-for-agent label 2026-10-17 02:35:38 +02:00
nessar added a new dependency 2026-10-17 02:35:38 +02:00
nessar added a new dependency 2026-10-17 02:35:38 +02:00
nessar added a new dependency 2026-10-17 02:35:38 +02:00
Author
Owner

CI-stability evidence gathered on 2026-10-19 while investigating the red pipelines of #304 and #305 (PR #307, closed without merging). It bears on this ticket's "benchmark protocol" and "successful required Gitea checks" criteria. I did not check whether any of it predates the Bun cutover.

1. Real-worker cancellation test is racy (not fixed on develop)

leave-planner.worker.spec.ts › "stops during calendar preparation without a plan or an obligation conflict" failed on #305's pull_request run (run 115, job test 960, 2026-10-19 07:39 UTC). The outcome was PlanningIncomplete (user-cancelled), but expect(outcome.incumbent).toBeUndefined() received a Plan that had already completed the validation, obligations and expiry stages, so the cancel took effect only after the calculation had gone past preparation.

Mechanism, from reading the code: the test cancels on the second preparation progress update. The cooperative driver (calculatePlanningAsyncInternal) yields one setImmediate turn per yield true, six more before the obligations stage (prepareCalendar loops over 2022 to 2028 for that horizon), and the worker reads its queue only between event-loop turns. Whether the host's cancel message arrives within those turns depends on scheduling. It is the same race that dfe6d28 fixed for the checkpoint cancellation test.

Not reproduced locally: the old test passed 20/20 on an idle machine and 15/15 on a CPU-contended core. So the diagnosis rests on the mechanism and the matching earlier fix, not on a red-to-green run.

Attempted fix (branch feature/ci-test-stability, commit af20c96): set the harness's existing holdForCancelAtStage = 'preparation' and cancel on the first preparation update (the worker blocks after that progress message until the cancel is delivered, so holding on the first message needs the cancel on the first update). The new test passed 20/20 idle, 10/10 under full CPU load and 15/15 on a contended core. Dropping PR #307 drops this fix too, so the test can still flake.

2. Benchmark gate: two years has almost no headroom when load changes mid-run

PR #307's pull_request run failed the benchmark (run 120, job 993): two years measured 1653.1 ms against a 1648.7 ms budget (multiplier 0.5 x calibration 3297.4 ms). The same commit's push run (run 118) passed with calibration 6394.6 ms (ratio 0.28). A re-run of the failed jobs passed. The change under test did not touch the planning engine.

Ratios to the calibration across the 8 benchmark runs of #304 to #307:

Scenario Quiet CI ratio Limit Headroom
two years 0.26 to 0.28 (0.50 in the failed run) 0.5 1.85x
three years 0.87 to 1.10 1.5 1.36x
loaded year 1.66 to 1.75 2.5 1.43x
representative year 0.07 0.15 2.1x

Calibration was 3.3 to 3.8 s on quiet runs and about 6.4 s on others. In the failed run the calibration was quiet and the scenarios then ran 1.5 to 1.8x slower than usual (1.52 to 1.78 s against about 1.0 s). From job timestamps, two test jobs, a build, the security scans and the start of the image build overlapped it on the single srvhome runner (inferred; the re-run overwrote the original job times). docs/gitea-actions.md already lists overlapping push and pull_request runs as load the gate cannot absorb.

Options considered:

  1. Raise the multipliers (loosens the regression tripwire).
  2. Calibrate again after the protocol and judge against the slower value (never tighter than today).
  3. Score each scenario by its best repetition instead of the mean (changes the documented "mean" standard).
  4. Make the benchmark needs: the heavy jobs (no cross-run isolation).
  5. Set the srvhome runner to capacity 1 (complete isolation, slower pipelines).

Option 2 is implemented in PR #308 (merged into develop as abfbca1). It leaves the multipliers unchanged, but it does raise the effective budgets when load is detected at the end of the protocol, so weigh it against this ticket's "Do not weaken tests, budgets, or gates". Its documented limit: load that ends before the second calibration is not absorbed. It ran in CI on #308's pull_request run (calibration 6383 ms before, 6395 ms after), but no run has yet had load starting mid-protocol; that case is only covered by a local load test. three years and loaded year have the least headroom and are the likeliest next flakes.

CI-stability evidence gathered on 2026-10-19 while investigating the red pipelines of #304 and #305 (PR #307, closed without merging). It bears on this ticket's "benchmark protocol" and "successful required Gitea checks" criteria. I did not check whether any of it predates the Bun cutover. ## 1. Real-worker cancellation test is racy (not fixed on `develop`) `leave-planner.worker.spec.ts` › "stops during calendar preparation without a plan or an obligation conflict" failed on #305's pull_request run (run 115, job `test` 960, 2026-10-19 07:39 UTC). The outcome was `PlanningIncomplete` (user-cancelled), but `expect(outcome.incumbent).toBeUndefined()` received a `Plan` that had already completed the validation, obligations and expiry stages, so the cancel took effect only after the calculation had gone past preparation. Mechanism, from reading the code: the test cancels on the second `preparation` progress update. The cooperative driver (`calculatePlanningAsyncInternal`) yields one `setImmediate` turn per `yield true`, six more before the obligations stage (`prepareCalendar` loops over 2022 to 2028 for that horizon), and the worker reads its queue only between event-loop turns. Whether the host's cancel message arrives within those turns depends on scheduling. It is the same race that `dfe6d28` fixed for the checkpoint cancellation test. Not reproduced locally: the old test passed 20/20 on an idle machine and 15/15 on a CPU-contended core. So the diagnosis rests on the mechanism and the matching earlier fix, not on a red-to-green run. Attempted fix (branch `feature/ci-test-stability`, commit af20c96): set the harness's existing `holdForCancelAtStage = 'preparation'` and cancel on the first `preparation` update (the worker blocks after that progress message until the cancel is delivered, so holding on the first message needs the cancel on the first update). The new test passed 20/20 idle, 10/10 under full CPU load and 15/15 on a contended core. Dropping PR #307 drops this fix too, so the test can still flake. ## 2. Benchmark gate: `two years` has almost no headroom when load changes mid-run PR #307's pull_request run failed the benchmark (run 120, job 993): `two years` measured 1653.1 ms against a 1648.7 ms budget (multiplier 0.5 x calibration 3297.4 ms). The same commit's push run (run 118) passed with calibration 6394.6 ms (ratio 0.28). A re-run of the failed jobs passed. The change under test did not touch the planning engine. Ratios to the calibration across the 8 benchmark runs of #304 to #307: | Scenario | Quiet CI ratio | Limit | Headroom | |---|---|---|---| | two years | 0.26 to 0.28 (0.50 in the failed run) | 0.5 | 1.85x | | three years | 0.87 to 1.10 | 1.5 | 1.36x | | loaded year | 1.66 to 1.75 | 2.5 | 1.43x | | representative year | 0.07 | 0.15 | 2.1x | Calibration was 3.3 to 3.8 s on quiet runs and about 6.4 s on others. In the failed run the calibration was quiet and the scenarios then ran 1.5 to 1.8x slower than usual (1.52 to 1.78 s against about 1.0 s). From job timestamps, two `test` jobs, a build, the security scans and the start of the image build overlapped it on the single `srvhome` runner (inferred; the re-run overwrote the original job times). `docs/gitea-actions.md` already lists overlapping push and pull_request runs as load the gate cannot absorb. Options considered: 1. Raise the multipliers (loosens the regression tripwire). 2. Calibrate again after the protocol and judge against the slower value (never tighter than today). 3. Score each scenario by its best repetition instead of the mean (changes the documented "mean" standard). 4. Make the benchmark `needs:` the heavy jobs (no cross-run isolation). 5. Set the `srvhome` runner to capacity 1 (complete isolation, slower pipelines). Option 2 is implemented in PR #308 (merged into `develop` as abfbca1). It leaves the multipliers unchanged, but it does raise the effective budgets when load is detected at the end of the protocol, so weigh it against this ticket's "Do not weaken tests, budgets, or gates". Its documented limit: load that ends before the second calibration is not absorbed. It ran in CI on #308's pull_request run (calibration 6383 ms before, 6395 ms after), but no run has yet had load starting mid-protocol; that case is only covered by a local load test. `three years` and `loaded year` have the least headroom and are the likeliest next flakes.
nessar added the blocked-on-bun-release label 2026-10-19 15:41:28 +02:00
nessar removed the ready-for-agent label 2026-10-19 16:41:55 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: nessar/vac-optimizer#293