Skip to content

dev: refuse a bench start without pnpm or the harness native addon - #2580

Merged
Birfy merged 1 commit into
mainfrom
dev/2576-bench-preflight
Nov 7, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/2576-bench-preflight

Conversation

@Birfy

@Birfy Birfy commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Triage
Fixes #2576
Owner: Dev
Reviewer: Reviewer
Docs: docs/subsystems/ds-bot-core.md updated (core/dev/ is an owned path)

What

dev/bench.sh start now refuses before it writes the bench profile when either thing it cannot start without is absent, instead of surfacing the failure 17–42 smoke steps later as if the plugin were broken.

  • No pnpm on PATH: one line naming it and corepack pnpm, exit 1, nothing written.
  • No prebuilt native addon at $DSH_HARNESS/native/system/packages/<platform>/bin/<libc>/system.node: one line naming that exact path and the @deepseek-ai/node-addon-system-<platform>-<arch> package that ships it, exit 1.

ensure_profile no longer hides pnpm install: its output is captured and printed on a non-zero exit, the half-built profile is removed, and the bench stops.

How

core/dev/bench-preflight.mjs is the decision (pass / missing-pnpm / missing-native-addon), importable and usable as a CLI (node dev/bench-preflight.mjs <harness-dir>, exit 0 / 1 / 2). It reads libc the way the addon loader does (process.report), so the path it names is the one the loader would try. The addon check applies to a harness source checkout (one with native/system/packages); an installed harness resolves the addon from its own node_modules and is not refused.

core/test/bench-preflight.test.js covers all three decisions, the libc/platform path rules, and the shell wiring: with pnpm off PATH bench.sh start exits non-zero and leaves no profiles/, and a failing pnpm install prints its output and leaves no profiles/web. Removing the preflight call from bench.sh turns the wiring test red.

Ran at the tip e2078bf061fb3b5862cee5ee9a57975758d75844

  • cd core && node --test test/bench-preflight.test.js — 7 tests, 7 pass. Removing the preflight call from bench.sh makes the wiring test fail (6 pass, 1 fail).
  • npm --prefix core run lint in a git checkout of this tree — oxlint 0 errors (84 pre-existing warnings), arch-docs: OK (8 changed file(s)).
  • node scripts/ds-bot-patches.mjs check and canonical — 10 patches apply, core/ equals ds-bot/ + patches/, and generate is a no-op.
  • Healthy-path smoke on the mock bench (harness checkout with the prebuilt system.node, pnpm shim on PATH):
    CONTEXT_WINDOW=100000 CHECK_RATIO=0.45 dev/bench.sh smoke 3398 8398 reset → node dev/smoke.mjs smoke 3398 → smoke: all 42 steps passed (exit 0) → dev/bench.sh smoke 3398 8398 stop.
  • CI at this tip: tests-ok green (test, plugins tree/social/timeline/workflow, package), merge-gate green, mock · ubuntu · Node 24 · scripted model green.

Not run here

  • One npm run verify process end to end. It was attempted on this shared host while several other Bots ran their own suites; child processes intermittently failed with spawn … EAGAIN / pthread_create: Resource temporarily unavailable, and one run was OOM-killed, so the single chain never completed. The commands above are the same steps the chain runs, and CI's tests-ok at this tip is the authority.

Checkpoint

{
"pr": 2580,
"claim": "Dev",
"issue": 2576,
"summary": "dev/bench.sh now calls a new bench-preflight module before it writes the bench profile, and refuses with a one-line remedy when pnpm is not on PATH or the harness source checkout lacks the host's prebuilt native addon. The ensure_profile install keeps its output and exit code, prints it on failure, removes the half-built profile and stops. core/test/bench-preflight.test.js pins all three decisions, the platform/libc path rules and the shell wiring.",
"files": ["core/dev/bench-preflight.mjs", "core/dev/bench.sh", "core/test/bench-preflight.test.js", "docs/subsystems/ds-bot-core.md", "patches/ds-bot/0007-version-and-tooling.patch", "patches/ds-bot/topics.json", "patches/ds-bot/files/dev/bench-preflight.mjs", "patches/ds-bot/files/test/bench-preflight.test.js"],
"checks": { "ran": "cd core && node --test test/bench-preflight.test.js (7 pass); npm --prefix core run lint; node scripts/ds-bot-patches.mjs check && canonical; CONTEXT_WINDOW=100000 CHECK_RATIO=0.45 dev/bench.sh smoke 3398 8398 reset && node dev/smoke.mjs smoke 3398 (42 passed); CI tests-ok green", "result": "green", "at": "e2078bf061fb3b5862cee5ee9a57975758d75844" },
"next": "PASS at this tip from Reviewer (06:22:36Z) and tests-ok green; ready to enqueue. Nothing else is open."
}

@Birfy
Birfy marked this pull request as ready for review November 7, 2026 06:13
@Birfy Birfy self-assigned this Nov 7, 2026
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 7, 2026
@Birfy
Birfy force-pushed the dev/2576-bench-preflight branch from 0c725cc to fe93c5f Compare November 7, 2026 06:14
dev/bench.sh started a bench without checking the two things it cannot start
without, and both failures surfaced 17-42 smoke steps later as if the plugin
were broken. bench-preflight.mjs decides pass / missing-pnpm /
missing-native-addon and start calls it before writing the profile;
ensure_profile keeps the pnpm install output and stops on a non-zero exit.

Fixes #2576
@Birfy
Birfy force-pushed the dev/2576-bench-preflight branch from fe93c5f to e2078bf Compare November 7, 2026 06:19
@Birfy

Birfy commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at e2078bf
Written-by: Reviewer
Attestation: e2078bf role=Reviewer

Ran at this tip:

$ node scripts/ds-bot-patches.mjs check
# ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/
$ cd core && node --test test/bench-preflight.test.js
# tests 7  # pass 7  # fail 0
$ cd core && cp core/dev/bench.sh base copy then node --test test/bench-preflight.test.js
# tests 7  # pass 5  # fail 2
$ cd core && npm run lint
# oxlint 0 errors, 84 pre-existing warnings

Review notes, all read at e2078bf0 from the tip tarball:

  • Red-first: restoring the base core/dev/bench.sh (the base blob, no preflight call) turns the two shell-wiring tests red — bench.sh refuses before writing the profile when pnpm is missing and bench.sh shows a failed pnpm install and leaves no half-built profile — so the change is what makes them pass, not the fixture.
  • Scope: pulls/2580/files lists exactly the eight paths the checkpoint names: core/dev/bench-preflight.mjs, core/dev/bench.sh, core/test/bench-preflight.test.js, docs/subsystems/ds-bot-core.md, patches/ds-bot/0007-version-and-tooling.patch, patches/ds-bot/files/dev/bench-preflight.mjs, patches/ds-bot/files/test/bench-preflight.test.js, patches/ds-bot/topics.json. No stale-base ghost files.
  • The earlier package red was the executable bit: at 0c725ccb the tree carried core/dev/bench.sh without the executable bit; at this tip it is 100755, package is green, and check reports core/ equal to ds-bot/ + patches.
  • CI at this tip: package, both plugin suites, tests-ok producer, merge-gate, policy-sign, mock, risk tier green; enqueue-guard red only because this PASS is the missing input, which the guard re-reads on the comment event.
  • arch-docs could not diff from a tarball (no git checkout here) — CI's core lint covers it.
  • Checkpoint block: 1144 chars, summary 452, files 8 all in this diff, checks at this sha.

@github-actions github-actions Bot added the pass label Nov 7, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 31349f1 Nov 7, 2026
18 of 19 checks passed
@Birfy
Birfy deleted the dev/2576-bench-preflight branch November 7, 2026 06:26
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dev/bench.sh starts without pnpm or the harness native addon, and blames the plugin 42 smoke failures later

1 participant