ReviewOS

home-lang/home

Bun parity: implement inspector module and enabled lifecycle contracts

#428
Open chris opened this 8 days ago ·
8 days ago

Native profiler sharing at 5cd57e8ea with verified evidence: CLI and inspector owners consume actual JSC samples through detached native records, preserving CLI JSON/Markdown history and independent repeated session windows. Shortest active owner interval is selected; session stop/disconnect preserves CLI profiling and active-session process exit exports successfully. Debug 56/56, all 28 native groups, 14 ABI controls/453 assertions and 32 report-validator controls pass. Twenty unchanged originals retain 53 passed cases, one failed unsupported Runtime.evaluate expectation and 17 process checks; no skips/TODO/filter/retries and no #886 pass credit. Evidence preserves the first inlined-workload assertion failure and 64 replayed report outcomes including 12 negatives; earlier eight resource stops remain in investigation evidence. Full Bun parity, complete realms, worker-to-main inspector attachment, coverage, precise cadence measurement, all ownership schedules, Release/ASAN/all-platform remain open under #428/#66.

Native local Session connect/post/disconnect now dispatches actual JSC commands, routes independent session IDs, emits registered owner-context notifications, supports nested posts/callback disconnect, and retires at process/worker/test-global shutdown. Native Profiler agents derive real sampled profiles and independent session boundaries, with actual definition locations/source IDs and integer timing. Bun synchronous results and actual-main connectToMainThread convenience are preserved; worker-to-main attachment still rejects rather than attaching locally.

Source 035d2a491, verified evidence. Home owns the pinned inspector controller implementation with unchanged header layouts. It releases non-owning checked references before agent destruction and destroys shared frontend state only after the last frontend disconnects. The initial worker teardown abort and 240-second memory deadline are retained; focused and broader exact-source shutdown tests pass, without claiming the timeout's cause resolved.

56/56 Debug steps, all twenty-eight native groups, ordinary protocol/sampling controls, fourteen ABI controls (453 assertions) and 32 validator controls pass. Twenty unchanged originals retain 53 passed cases, one failed “Runtime is unsupported” expectation, plus seventeen process checks. #886 tracks that stale contract; no pass credit or assertion rewriting is used. All 1054 artifacts, fifteen source hashes and 148 report outcomes replay, retaining 25 negatives. Explicit Pickier keeps ten baseline warnings/zero errors and zero new findings; formatting/docs pass.

Still incomplete: all VM-context enumeration/lifecycle, worker-to-main attachment and NodeWorker events, debugger pause/resume, enabled open/close/URL/wait lifecycle, full CDP/WebKit schema compatibility, coverage, tamper-resistant primordials, every shutdown schedule, Release/ASAN/all-platform and full suite. The original acceptance criteria remain below; this issue stays open.

Acceptance criteria:

  • import or add current concrete enabled-inspector upstream coverage
  • implement inspector.Session connect, post, disconnect, and notification behavior
  • implement internal inspector command dispatch
  • model CLI enable, URL, wait, and shutdown lifecycle
  • support worker inspector attachment and NodeWorker events
  • add maintained focused tests and remove any successor expectations only when green

Parent tracker: #66

8 days ago

VM/inspector ownership checkpoint (2026-10-10): source 5808f4149 and verified evidence. Home owns 125 registry modules plus the internal test adapter, adding seven modules and six native VM/profiler sources. All 20 selected implementation/header files match the Bun pin exactly. 77 unchanged original files: 62 registered passes plus 70 process checks, zero failures, skips or TODOs cover ordinary context/module state, cached scripts, async graphs, source URLs, profiler structure, serialization and console behavior. Both host and final Home ABI gates pass 101 tests / 1,512 assertions; seven native groups and Debug 34/34 pass. Build peak 5,658 MB under 8,192 MB; Home ABI 412 MB, original runs 219/185 MB under 3,840 MB. 447 committed archives verify and 77 reports restore. Disk refusals receive no credit; obsolete cache cleanup retains newest objects and invalidates discarded-output manifests. Ownership does not complete pinned stubs: inspector lifecycle remains #428, real per-context VM memory accounting is #870, and tracing/REPL, remaining module/native ownership, complete suite and Release/ASAN/all-platform verification remain open.

8 days ago

Native CLI CPU and heap profiling are implemented on main in source 25f08362b with verified evidence. Both empty disk writers are replaced by actual engine exporters, correct native string ownership and output-path behavior. The native run path applies configuration, starts CPU sampling under API lock before evaluation, and uses the existing idempotent VM shutdown hooks. JSON/Markdown, custom/default names, nested destinations, dual CPU formats and explicit process.exit heap output are covered.

54/54 Debug steps; sixteen cases across both byte-identical pinned profiling originals; five native groups; fourteen ABI controls with 452 assertions; 32 report-validator controls. No original failure, skip, TODO, filter or retry. Pickier, formatting and documentation paths pass. All 43 evidence artifacts, four source hashes and both original report replays verify.

#885 remains incomplete: direct Script.runInContext also retains the last evaluated realm. Refined probes show the JIT-worklist code roots observed in the prior investigation belong to host code, so they do not establish the sandbox owner. Temporary probes are restored and excluded from production. Release/ASAN, Linux/Windows and full Bun-suite parity remain unproven.

8 days ago

Native CPU profiler ownership is fixed on main in 28e9d1054, with 433 verified evidence artifacts.

The baseline worker Session disconnect stopped parent profiling on Home while Node passed. Running state, sampling interval and start timestamp now belong to the actual JSC VM. Explicit VM contracts wire CLI/inspector calls. Shutdown exports requested CLI output first, then stops/removes sampling state. Parent samples and function names survive an idle worker disconnect and an active profiling worker's natural exit. The complete C++ profiler implementation is now Home-owned in its ABI-matched unified source; the public header remains byte-identical.

54/54 Debug steps; twenty-eight native groups; twenty unchanged selected files with 54 passed cases plus seventeen process checks; fourteen ABI controls with 452 assertions; 32 report-validator controls. No original failures/skips/TODOs/filters/retries. All 433 artifacts, nine source hashes and 64 report outcomes replay, retaining eleven deliberate negatives. Explicit Pickier, formatting and docs checks pass.

Six pinned inspector assertions cover unsupported/partial behavior and receive no implemented-feature credit. Full native protocol sessions, same-VM per-session agents, notifications, worker attachment, open/close/URL/wait lifecycle, legacy same-thread multi-VM callers, #885 retirement, all-platform/Release/ASAN and full Bun-suite proof remain incomplete. #428 stays open with its original acceptance criteria.

8 days ago

Verified native generation input tracking is on main in 531cdfdfc, with 47 verified investigation artifacts. HomeCPUProfilerState.h and BunCPUProfiler.cpp now invalidate generation. Header-only/source-only marker probes each regenerate the copied owned input, then restore bytes and clean output. native-runtime-modules invokes the same generator without compilation/linking.

The final 54/54 restored build is byte-identical to the tested binary. Maintained profiler behavior, VM memory/shutdown, corpus dispatch, fourteen ABI controls and 32 report-validator controls pass. Source/format/docs checks and all committed artifact hashes verify. The unrelated TS origin update was rebased without altering tested input/archive bytes.

The real native inspector transport prototype evaluates ordinary expressions and independently routes session IDs, but unchanged context-created notification assertions fail. Bare JSC global runtime agents emit no creation notification on enable, and JSC ScriptProfiler is not the CDP Profiler contract. Proper context/profiler agents, worker attachment and enabled lifecycle remain required. The unready replacement is preserved locally and excluded from main; published inspector/profiler source is restored. No fabricated protocol results or weakened notification assertions are used. #428 and #66 stay open.

8 days ago

Native local inspector sessions and sampled profiler agents are on main in 035d2a491, with 1054 verified artifacts.

GC-traced local channels dispatch actual JSC commands, route session-specific IDs, deliver registered owner-context notifications, support nested posts/callback disconnect, and retire on shutdown/global replacement. Native sampling brokers retain only immutable verified-frame data and preserve independent start/stop boundaries. Profiles use actual definition metadata, source IDs/URLs and integer microsecond timing. Bun's synchronous result extension and actual-main convenience are retained through real native dispatch; workers do not silently attach locally.

Owned pinned controller teardown releases non-owning checked references before destroying agents, and shared agents stay enabled until the last frontend disconnects. The initial checked-reference worker abort, earlier 240-second measurement deadline, compile/type/API failures, harness error and disk stops remain in evidence. Later focused and broader exact-source shutdown checks pass; the deadline cause is not claimed resolved.

56/56 Debug steps; all twenty-eight native groups; positive evaluation/notification/routing/reentrancy/reconnect/profile controls; fourteen ABI controls with 453 assertions; 32 validator controls. Twenty unchanged original files retain 53 passed cases, one failed unsupported-runtime expectation, plus seventeen process checks. #886 tracks the obsolete case, with no pass credit. All 148 report outcomes replay, retaining 25 negatives; fifteen source hashes match tested bytes. Pickier matches zero errors/ten baseline warnings, zero new findings; formatting/docs pass.

#428 stays open for full context lifecycle, worker attachment, debugger pause/resume, open/close/URL/wait lifecycle, full protocol schemas, coverage, CLI/session sampling coexistence, primordials, every shutdown schedule and all-platform/Release/ASAN. #885/#870 and full Bun-suite parity remain incomplete.

8 days ago

Profiler ownership follow-up: preserved evidence shows the ordinary Node control retains CLI before/during/after samples and inspector-only session samples; verified Home rejects session startup while CLI profiling is active. Proposed native detached-record/shared-owner code and repeated-session/shutdown regressions are preserved on recovery source 0ebc3c208, excluded from main. All eight guarded Debug attempts stopped for shared disk (seven) or host memory (one), despite about 10.6 GiB inactive cache/log cleanup. No completed build or new runtime pass credit. Main runtime remains at 035d2a4 / verified evidence 7e0f249. #428 and #66 stay open; the unchanged #886 original-test conflict is retained.

8 days ago

Native profiler sharing at 5cd57e8ea with verified evidence: CLI and inspector owners consume actual JSC samples through detached native records, preserving CLI JSON/Markdown history and independent repeated session windows. Shortest active owner interval is selected; session stop/disconnect preserves CLI profiling and active-session process exit exports successfully. Debug 56/56, all 28 native groups, 14 ABI controls/453 assertions and 32 report-validator controls pass. Twenty unchanged originals retain 53 passed cases, one failed unsupported Runtime.evaluate expectation and 17 process checks; no skips/TODO/filter/retries and no #886 pass credit. Evidence preserves the first inlined-workload assertion failure and 64 replayed report outcomes including 12 negatives; earlier eight resource stops remain in investigation evidence. Full Bun parity, complete realms, worker-to-main inspector attachment, coverage, precise cadence measurement, all ownership schedules, Release/ASAN/all-platform remain open under #428/#66.

8 days ago

Inspector realm follow-up: evidence c8c0db677 confirms Node enumerates real named VM contexts/origins and evaluates through contextId, while verified Home emits only its owner and fails the named-realm assertion. Pinned JSC owns one global per runtime controller and rejects execution-context IDs. Native weak realm metadata, original-order name/origin capture, owner-loop retirement and per-realm controller/object routing are drafted on recovery source a7b7b86ab, excluded from main. The initial helper namespace compile failure and repaired source are preserved; repair builds were refused below disk admission. No new runtime pass credit. Remote-object arguments/groups, controller roots and realm/owner teardown require implementation and tests. Main runtime remains at the verified profiler-sharing checkpoint. #428/#66/#885/#886 stay open.

8 days ago

Inspector realm lifecycle/routing follow-up: evidence 5c00c7ef6 preserves recovery source 753992ce5: identity-checked deferred realm retirement, owner registry cleanup, nested object-ID argument unwrapping, object-group forwarding, suppression of internal responses, explicit empty names and owner-context evaluation dispatch. Prepared metadata/evaluation/object/getter controls remain unexecuted against a completed repaired executable. Three admission refusals and one admitted build stop at 427 MB free (512 MB floor) retain failure status; the supervisor stopped an escaped compiler child. No new runtime pass credit; source stays excluded from main. Native controller roots, object/argument/group/exception schemas, async commands, retirement/worker teardown and all regression/ABI proof remain required. Main runtime remains the verified profiler-sharing checkpoint; #428/#66/#885/#886 remain open.

8 days ago

Inspector realm build follow-up: evidence 78b31c237 preserves recovery source b0c7b30b4, with common native execution-context IDs and repaired JSON Ref<value> routing access. Initial native build reached 50/56 steps and failed only on the two corrected Ref dereferences. The repaired admitted build stopped at the disk guard: 509 MB free versus 512 MB critical floor. More than 6 GiB old duplicate native objects were removed, preserving newest/active/protected outputs; cache manifests were preserved and invalidated normally. Controls remain unexecuted against a completed repaired executable, with zero new runtime pass credit. Shared-volume exhaustion has repeated across three consecutive realm-work turns and blocks validation until stable build headroom exists. Main retains the verified profiler-sharing runtime; recovery realm source remains excluded. Native controller roots, all protocol/lifecycle/worker schedules and complete original/native/ABI/all-platform proof remain required. #428/#66/#885/#886 remain open.

8 days ago

Inspector realm controls (2026-10-13): evidence b3b54f095 records a completed 56/56-step Debug build of recovery source b0c7b30 (peak 5705 MB), four passing Node controls and the passing Home control that enumerates before/after named VM realms with origins and evaluates through their context IDs. The next Home metadata/disable/re-enable control aborts at 0x5. Code inspection found isString on empty metadata lookup values; explicit empty guards are pushed on recovery repair 6dba78586. Repair runtime remains unverified because its build stopped after eight failed memory measurements. Initial measurement failure, successful build/control and abort are preserved separately in 22 verified artifacts. Realm source remains excluded from main; no complete feature/pass credit. Installed investigation binary is recovery output and must not credit restored main without rebuilding. Metadata/object/lifetime/worker/protocol, full native/original/ABI and all-platform proof remain required; #428/#66/#885/#886 stay open.

8 days ago

Inspector metadata repair (2026-10-13): evidence 2b9c2058c proves a 56/56-step Debug build, four passing Node controls and two passing Home controls: named-realm enumeration/evaluation and unchanged metadata disable/re-enable. The prior absent-metadata crash is repaired. The next two-realm object control aborts at 0x10; crash frames locate unwrapInspectorObjects, where missing objectId leads to a null string-map key after maps are populated. Null-key guards and maintained regressions are pushed on recovery aac562b7c; their normal rebuild is queued behind a confirmed live qualification job. Zero repaired-object or complete-feature credit. #888 now tracks remote objects, nested arguments/groups/errors, controller roots and teardown; #428 remains the inspector parent. Source stays excluded from main pending focused and original/native/ABI verification. #66/#885/#886 remain open.

8 days ago

Native VM inspector realms (2026-10-13) landed in source 2d9025ce5 with verified evidence 3179edc81. Real VM contexts preserve names/origins/native identities; evaluation, distinct remote handles, own properties and release route to the owning JSC controller. Foreign-world arguments receive the Node inspector error; same-world arguments retain native identity. Native property responses translate to CDP result using the request method. Missing metadata/null-key guards prevent the earlier ordinary-control aborts. Debug build and current-main integration: 56/56 each, identical tested executable. Seven Node and seven Home controls, 28 native groups, 14 ABI controls/453 assertions, 32 report-validator controls pass; lint/format/docs checks pass. Twenty byte-identical originals retain 53 passed cases, one failed unsupported-method expectation and 17 process checks, with no skips/TODO/filter/retries. All 64 report outcomes match expected counts/exits/errors, including 12 retained negatives. No #886 pass credit. Earlier aborts, incorrect cross-world expectation, baseline property failure and two infrastructure exits 127 remain documented. #888 retains controller roots/retirement, complete backend/async schemas and teardown; #428 retains full inspector acceptance. Full Bun suite, Release/ASAN, Linux/Windows and #885/#886 remain incomplete.

The 479 raw evidence artifacts have verified uncompressed hashes/byte counts. Both commits are pushed to main; the source checkout is clean and synchronized at publication. This is a validated increment, not full inspector or Bun-suite completion.

Sign in to comment on this issue.