Skip to content

feat(codemode): label self-hosted compiled binaries as native in eval runtime badges - #1199

Open
code-yeongyu wants to merge 3 commits into
mainfrom
feat/eval-native-runtime-badge
Open

feat(codemode): label self-hosted compiled binaries as native in eval runtime badges#1199
code-yeongyu wants to merge 3 commits into
mainfrom
feat/eval-native-runtime-badge

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

When a compiled standalone binary hosts the eval JS kernel itself (an omo/pi native build, e.g. omob), the eval header runtime badge now reads native instead of bun:

  • before: eval js (bun 1.4.0, ~/.omo/binary-runtime/5.0.0-.../omo)
  • after: eval js (native 1.4.0, ~/.omo/binary-runtime/5.0.0-.../omo)

The in-process JS kernel always runs on process.execPath; under a compiled binary that path IS the application binary, so labeling it bun was misleading. Detection mirrors the existing precedent in packages/coding-agent/src/config.ts: the module url of a compiled bun binary carries $bunfs / ~BUN / %7EBUN virtual-filesystem markers. No Bun-only APIs (package invariant), injectable signals for tests.

Deliberately unchanged:

  • stock bun runs keep bun <ver>, <path> and node runs keep node <ver>, <path>
  • the eval prompt host line stays bun <ver> — the model needs the engine capability surface, not the install identity (jsRuntimeLabel now passes nativeSelf: false explicitly)

Changes

  • src/extension/runtime-info.ts: isNativeSelfRuntime(signals) + jsRuntimeInfo(..., nativeSelf) third param (defaults to detection); doc comments
  • tests: runtime-info native/edge matrix, runtime-label native badge pin, eval-render native header pin
  • README + CHANGELOG [Unreleased]

QA evidence (real surface)

Compiled a standalone probe binary with bun build --compile importing the real runtime-info.ts + runtime-label.ts:

execPath=/private/tmp/ulw-native-badge-qa/probe-native
nativeSelf=true
runtime={"name":"native","version":"1.4.0","path":"/private/tmp/ulw-native-badge-qa/probe-native"}
header=eval js (native 1.4.0, /private/…/probe-native)

Stock bun control run of the same script (bun 1.4.0):

execPath=/Users/yeongyu/.bun/bin/bun
nativeSelf=false
runtime={"name":"bun","version":"1.4.0","path":"/Users/yeongyu/.bun/bin/bun"}
header=eval js (bun 1.4.0, ~/.bun/bin/bun)
  • packages/senpi-codemode vitest suite green; root npm run check green (transcripts captured)
  • TDD: native cases captured RED (expected 'native', received 'bun'; false ≠ true marker matrix) before implementation

Summary by cubic

Labels the eval header runtime badge native when a compiled standalone binary hosts the JS kernel itself, instead of the misleading bun.

  • Detection trusts a Symbol.for("@earendil-works/pi-coding-agent:compiled-binary-host") signal published by the coding-agent binary loader, with anchored $bunfs/~BUN module-url shapes as fallback; the host signal is needed because sidecar extensions load from disk and carry no marker.
  • isBunBinary detection in packages/coding-agent is now anchored to the exact virtual-filesystem URL shapes so a stock bun run from a disk path containing a marker segment no longer misclassifies as compiled.
  • Stock bun and node badges and the eval prompt host line are unchanged.

Written for commit bfaa8fd. Summary will update on new commits.

Review in cubic

@code-yeongyu

Copy link
Copy Markdown
Owner Author

ultrabrain review (round 3) — VERDICT: APPROVE

Reviewer: ultrabrain category (quotio-openai/gpt-5.6-sol:xhigh), 3 review epochs, two REQUEST_CHANGES rounds fixed and re-verified.

The round-2 delta closes the remaining production blocker. isBunBinary now uses the anchored isCompiledBunBinaryUrl() predicate, so marker-infix stock Bun paths no longer enter the loader's compiled-host branch; the loader signal, codemode detection, sidecar behavior, native badge, and unchanged bun prompt label are all consistent end to end.

Verification performed: detector + blast-radius tests 13 passed; senpi-codemode suite 651 passed; runtime/render regression tests 41 passed; root tsc, Biome, dependency/lock/changelog gates all green; independent compiled-Bun smoke confirms embedded URLs classify compiled, marker-infix disk paths do not, sidecar URL alone stays bun, host signal produces native; git diff --check clean.

Non-blocking notes: none.

1 similar comment
@code-yeongyu

Copy link
Copy Markdown
Owner Author

ultrabrain review (round 3) — VERDICT: APPROVE

Reviewer: ultrabrain category (quotio-openai/gpt-5.6-sol:xhigh), 3 review epochs, two REQUEST_CHANGES rounds fixed and re-verified.

The round-2 delta closes the remaining production blocker. isBunBinary now uses the anchored isCompiledBunBinaryUrl() predicate, so marker-infix stock Bun paths no longer enter the loader's compiled-host branch; the loader signal, codemode detection, sidecar behavior, native badge, and unchanged bun prompt label are all consistent end to end.

Verification performed: detector + blast-radius tests 13 passed; senpi-codemode suite 651 passed; runtime/render regression tests 41 passed; root tsc, Biome, dependency/lock/changelog gates all green; independent compiled-Bun smoke confirms embedded URLs classify compiled, marker-infix disk paths do not, sidecar URL alone stays bun, host signal produces native; git diff --check clean.

Non-blocking notes: none.

… runtime badges

When a compiled standalone bun binary hosts the in-process JS kernel itself (an omo/pi native build), the eval header badge now reads 'native <ver>, <binary path>' instead of 'bun'. Detection mirrors the bunfs/~BUN/%7EBUN module-url markers used by coding-agent config; stock bun, node, and the eval prompt host line are unchanged.
…tion

Compiled binaries load codemode from the physical sidecar, so its module url carries no bunfs marker; the coding-agent binary loader now publishes Symbol.for('@earendil-works/pi-coding-agent:compiled-binary-host') before resolveBinaryFactory and codemode trusts that signal first. Module-url matching is anchored to the exact virtual-filesystem shapes so stock bun disk paths containing a marker segment never misclassify.
…stem url shapes

isBunBinary previously matched marker substrings anywhere, so a stock bun run from a disk path containing /~BUN/%7EBUN classified as a compiled binary and could publish the compiled-host signal, mislabeling the eval js badge as native. Adds detector regressions for each marker-infix disk path.
@code-yeongyu
code-yeongyu force-pushed the feat/eval-native-runtime-badge branch from fbc20a6 to bfaa8fd Compare August 30, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant