ReviewOS

zig-utils/zig-js

ABI: implement lifecycle and test reporter inspector agents

#396
Closed chris opened this 9 days ago ·
9 days ago

Parent: #140 Profiles: #163, #164 Roadmap: #134

Implement the eight shared pending LifecycleReporter/TestReporter private exports against the real zig-js inspector session and the pinned Bun 4982b91 protocol. The opaque agent handle identifies one live session; this is not a disconnected callback record or silent no-op.

Exports:

  • Bun__LifecycleAgentReportReload
  • Bun__LifecycleAgentReportError
  • Bun__LifecycleAgentPreventExit
  • Bun__LifecycleAgentStopPreventingExit
  • Bun__TestReporterAgentReportTestFound
  • Bun__TestReporterAgentReportTestFoundWithLocation
  • Bun__TestReporterAgentReportTestStart
  • Bun__TestReporterAgentReportTestEnd

Acceptance:

  • Advertise and implement exact LifecycleReporter/TestReporter domain enable/disable commands per session.
  • Emit reload and fully projected ZigException error events only while LifecycleReporter is enabled.
  • Preserve per-session prevent-exit state and clear it on stop, disable, detach, and release.
  • Emit found/start/end test events with exact enum strings, optional parent behavior, explicit-location handling, and live CallFrame source projection.
  • Reject invalid, detached, foreign, or wrong-domain handles without cross-session delivery.
  • Pin upstream source/protocol hashes and add allocation-failure/reentrant-release coverage.
  • Add compiled Home and Bun consumers in Debug and ReleaseSafe, refresh exact inventories, ABI docs, #134/#140/#163/#164, and bounded CI.

Backward compatibility is intentionally out of scope; the implementation follows the clean exact pinned behavior.

9 days ago

Implemented on main in bf847786 with documentation/CI in b187b027.

Evidence:

  • focused Debug unit: 3/3 passed, 0 failed, 0 leaked;
  • the payload allocator sweep reaches both injected OOM and success; invalid/dead input emits no partial event;
  • callback-driven session release is retained safely;
  • zig build test-private-inspector-agents compiles, links, and runs both Home and Bun profile libraries;
  • the same unit and both consumers pass ReleaseSafe;
  • pinned Bun 4982b91 source/protocol hashes validate through bun-private-abi.py --bun-root;
  • Home moved 410→418 implemented (53 pending); Bun moved 402→410 implemented (51 pending);
  • root README and ABI/API docs carry the new exact counts.

Targeted CI: https://github.com/zig-utils/zig-js/actions/runs/29766523096. Keeping this open until private-abi-boundary is green.

9 days ago

Completed on main through bf847786 and b187b027. The exact lifecycle/test-reporter contract, enable gates, payloads, reentrant detach, and dual-profile fixtures are green in the fixing private-abi-boundary job.

9 days ago

Post-completion inspector-agent hardening landed via #871 in 516a8d59. Private agent acquisition now validates the exact live tagged capability under the process registry lock and retains the session across reentrant callbacks; both pinned Home/Bun fixtures pass under TSan.

Sign in to comment on this issue.