Skip to content

observe, loopguard: recognize Bun, Deno, and polyglot test runners (Zig, Meson, Dart, Forge, Ninja) - #310

Open
Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/observe-bun-deno-and-polyglot-test-runners
Open

Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/observe-bun-deno-and-polyglot-test-runners

Conversation

@PStarH

Copy link
Copy Markdown

Summary

This PR fixes observation of Bun, Deno, and Node test runners in microskills, and expands test runner detection in loopguard across modern polyglot ecosystems:

  1. Microskills Observation (tokeneconomizer/microskills/observe.py):

    • bun, deno, and node in NODE_WEB.interpreters were previously intercepting shell commands before reaching task heads or _RUN_SCRIPT_HEADS, causing bun test, bun run test:unit, deno test, and node --test to be misclassified as run_interpreter instead of run_tests, and bun run build/deno check as run_interpreter instead of run_build.
    • Now, _classify() properly extracts:
      • bun test, bun run <test-script>, deno test, and node --test as run_tests;
      • bun run <build-script>, deno check/lint/fmt as run_build;
      • bun install/add, deno add/install as fetch_remote (with host extraction);
      • bun remove/update as package_tool.
    • Fixed base.startswith(...) in package tool extraction which erroneously matched bundle when checking for bun.
    • Added zig, meson, dart, flutter, forge to GENERIC.task_heads and build_heads.
  2. Loopguard Test Verification (tokeneconomizer/loopguard/turn.py):

    • VERIFY_RE now recognizes zig test, zig build test, meson test (including -C build), dart test, flutter test, forge test, and ninja/samu test/check.
    • Previously, test runs in these projects returned status_of_tests(...) -> None, which caused failing test runs after code edits to be ignored, erroneously qualifying failing turns as "ended green" in resolved_proxy().
    • Added failure/pass regex patterns in _RUN_FAILED_RE and _RUN_PASSED_RE for Meson and Dart/Flutter test suites.

Verification

  • Added tests/test_loopguard_polyglot_runners.py verifying status and TurnGuard.fold() across Zig, Meson, Dart, Flutter, Forge, and Ninja.
  • Added tests/test_observe_bun_deno.py verifying command classification across Bun, Deno, and Node --test.
  • Added test cases in tests/test_generic_microskills.py.
  • Ran full test suite: 225 passed in 13.97s.

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