Skip to content

fix(hopper): distinguish runtime processes from argument text - #2644

Closed
N0zoM1z0 wants to merge 16 commits into
mainfrom
fix/hopper-clean-runtime-argv
Closed

N0zoM1z0 wants to merge 16 commits into
mainfrom
fix/hopper-clean-runtime-argv

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

The Linux Hopper cleanup verifier mistakes runtime names in ordinary command arguments for surviving processes. Replacing rendered ps text matching with procfs arguments fixes those false positives, while retaining detection of reparented helpers, alternate launcher identities and unreaped runtime processes.

Read /proc/<pid>/cmdline once and recognize CPython's actual script operand, including interpreter options and --; forwarded names in -c/-m arguments remain ordinary arguments. If argv is gone, read the kernel command name: Hopper/Xvfb remnants block the lane, and an unidentified Python interpreter remains unknown. Preserve device/inode launcher identity, deferred caller-process inspection failures and observation without signaling. Shared process tests run in the existing serial boundary lane.

This follows merged #2638 and changes verification only. Production tool contracts, Evidence and agent payloads are unchanged.

Full native verification on a70d6376abdeb5ce86e327e24bb31754c0f124a0, based on main 11f1d952e:

  • Twenty focused tests and typecheck/lint pass. Real before/after probes reproduce both argument-text false positives and the missed Xvfb zombie. Real reparented Python cases cover option grammar and command/module forwarding; unreaped-child cases cover Hopper, Xvfb, Python uncertainty and an unrelated process. Detection neither signals nor reaps; the waiting fixture parent performs cleanup.
  • A fresh Ubuntu 24.04 x64 container, empty HOME and approved official Hopper 6.4.2 demo installation pass setup planning, scoped doctor, CLI/MCP conformance, zero-action repeated setup, modified-launcher rejection and clean teardown. All 3,301 source hashes are unchanged before/after.
  • Native verification covers 191 schemas, 180 successful and 63 rejected boundary calls, 1,205-item inventories, cancellation/deadline recovery, and graceful/SIGKILL owner exits with same/different-target reuse. The unrelated-process sentinel is Node titled Hopper; a second simultaneous real demo GUI is not claimed.
  • Full native/setup execution: 115.30 s wall, 138.40 s dedicated-container CPU, 1.78 GiB sampled summed RSS peak. Fixtures/runtime were built beforehand; installation and HOME were fresh. RSS is a 50 ms sample sum with shared pages counted per process, not PSS.
  • Thirty alternating warm clean-runner observer trials: median 6.54 -> 1.79 ms, p95 8.33 -> 2.44 ms against the original ps observer. No extra child process or persistent process-state cache. This measures verifier overhead, not analysis speed or agent tokens.

Real-provider scope excludes macOS, other Hopper builds, saved-database persistence and synchronous native interruption. Raw long/Unicode bytes are verified independently; native decoded objects absent from the demo remain explicitly unverified.

Current head b2e743ef2461fc3ed8212ef0830a4494add91ed4 retains the maintainer's merge of upstream CI baseline fixes (51b3418f2). The observer and declaration bytes remain identical to the fully native-verified head above. The latest review found a fixture ownership gap on containers whose PID 1 does not reap adopted children. The fixtures now retain their own Linux subreaper through token-verified group cleanup, then wait for each adopted child and assert procfs disappearance. A separate verifier still proves that these children are outside its own lineage; no observer mutation authority was added.

The exact preceding head reproduces two failed negative cases and eight residual zombies in an Ubuntu 24.04 container deliberately running without --init. The corrected fourteen process cases pass in the same environment, with no residual children. The twenty related checks pass on the host; final fixture refactoring is verified by the no-init run, typecheck and lint. This revision changes only the test fixture; the full real-provider scope and performance measurements above retain their stated source binding. All five implementation/test commits retain the requested GitHub co-author trailer, which will also be preserved in the squash commit.

CI and automated reviews are running on this updated head. The formerly blocking dyld fixture was fixed upstream in #2755 and is present through the maintainer merge; no unrelated baseline correction is included in this PR.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

CI failures were reproduced on both the exact CI merge 4f0f54ee39f0dfd7f00858152cf1080023e68f20 and its untouched main parent 4276aaf18bb607cdd0182280f76cf50fcd110c3c: duplication has identical clone/duplicated-line/token counts, and the same IDA FAT alignment fixture fails on both. This patch adds no duplicate clone and changes none of the IDA producer/resolver/fixture files. Relevant local checks and the exact-head real Linux Hopper setup/native workflow passed. Details and precise native scope are in the PR description; unrelated changes are excluded.

@N0zoM1z0
N0zoM1z0 marked this pull request as ready for review October 13, 2026 07:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T07:32:28.174404Z 98b87e7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Refactors process detection logic for demo cleanup.

Fix the older Linux helper test before merging.

Findings

  1. P1 Linux helper test always fails ▶
Fix with agent prompt
### Issue 1
tests/process-global/cleanLinuxHopperRuntime.test.ts:77-81
Only the “alternate launcher” case adds its child to `procRoot`. The “demo helper” case leaves that directory empty. Since `assertCleanLinuxHopperRuntime` now reads only `procRoot` instead of also running `ps`, it returns successfully while this test expects rejection. This breaks the Linux test suite.

Add the child’s procfs links in both cases, or remove this older test in favor of the new boundary coverage.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR replaces rendered ps text matching with procfs arguments and kernel command names.

  • The Linux cleanup check distinguishes runtime processes from argument text.
  • The Hopper search declaration keeps its type imports at the top.

Reviews (17) · Last reviewed commit: "chore(main): merge pinned CI checkpoint ..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cd88dd5ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0
N0zoM1z0 force-pushed the fix/hopper-clean-runtime-argv branch from 40479c1 to a2e4b07 Compare October 13, 2026 08:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2e4b0728d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Final-head CI 38370029543: all 20 related regressions pass (14 observer tests in shard 4, six string-verifier tests in shard 1), as do static checks, packaging and all platform lanes. Shard 2 fails only the untouched JavaScript structure assertion at line 74: expected local/null but received unknown/"Parameter provenance depends on caller arguments." Exact CI merge 4b928a8 has main parent b69d20a. Running that file on this exact main parent reproduces the same single failure, with 23 other cases passing; the branch reproduces it identically. The merge changes only the four observer/declaration/test paths. No JavaScript correction is included. Full exact-head official Hopper 6.4.2 setup/native verification remains green; both reviews are complete and all threads resolved. Required CI aggregation is pending.

@N0zoM1z0
N0zoM1z0 force-pushed the fix/hopper-clean-runtime-argv branch from a70d637 to 5fbeeed Compare October 13, 2026 09:30
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

CI run 38376781088 on merge 25f06ac: shard 3 fails four releaseCheckpoint cases with ZodError at jobs.qualification.steps (expected array, received undefined). Exact untouched main e05d339 reproduces the same four failures, with 35 other cases passing. The new qualification job uses a reusable workflow and has no steps; the test parser assumes every job has steps. Neither the release workflow nor this test is changed by this PR, and current main d13c9f8 leaves them unchanged. The previous JavaScript failure is fixed upstream and its 24 cases pass. The Windows lane separately timed out after printing a complete web-module CLI result; its source/test are unchanged, and I will retry that lane after the run becomes eligible. Both latest-head reviews are complete and all discussion threads are resolved. No unrelated release or Windows change is included.

N0zoM1z0 and others added 4 commits October 13, 2026 10:26
Parse procfs argument boundaries rather than searching rendered ps command text. Keep executable identity checks and deferred permission failures, eliminate the extra ps process, and put shared process observations in the serial process-boundary lane.

Co-authored-by: Kaoru0822 <[email protected]>
Launch a real Python child with the helper filename, wait for readiness before the Node parent exits, bind its procfs arguments, require non-signaling detection, and clean it through the existing run-token/group identity primitive.

Co-authored-by: Kaoru0822 <[email protected]>
Resolve the script operand using CPython option boundaries, including combined flags, separate or attached option values, and --. Keep command/module arguments distinct and defer unknown invocation failures rather than declaring them clean.

Co-authored-by: Kaoru0822 <[email protected]>
Use the kernel command name for processes without argv or an executable link. Preserve uncertainty for command-less Python interpreters and detect Hopper/Xvfb zombies without signaling. Real unreaped-child regressions keep cleanup with their waiting parent.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0
N0zoM1z0 force-pushed the fix/hopper-clean-runtime-argv branch from 5fbeeed to 3bb09b8 Compare October 13, 2026 10:28
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Current-head CI 38383599981 on merge 1de1d06: 32 jobs pass, and the sole actual test failure is dylibResolutionCli.test.ts / "reports each same-named slice's own embedded dyld environment". It refuses the fixture with "FAT binary has no host-compatible x64 architecture". Exact untouched main parent 747e729 reproduces this same single failure, with ten other cases passing. This PR changes only its four verification/declaration/test paths, with no dyld/Mach-O producer or fixture changes. Earlier JavaScript and release-preflight baseline failures are fixed upstream; the Windows lane passes in this run. Both latest-head reviews remain complete, with all threads resolved. Full real Linux Hopper verification and the 83 focused current-head checks remain green. No unrelated dyld correction is included.

N0zoM1z0 and others added 2 commits October 13, 2026 12:25
Keep a test-owned Linux subreaper until token-verified process-group cleanup completes, then wait for each adopted child. Observe from a separate verifier so the orphan remains outside its lineage. Assert disappearance from procfs after reaping.

Reproduced two failures and eight retained zombies without an init reaper. The corrected fourteen process cases pass with no residual children; typecheck and lint pass.

Co-authored-by: Kaoru0822 <[email protected]>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: build Build, CI, packaging, and publishing P2: medium Medium priority issue labels Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f83c64da8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

morluto added a commit that referenced this pull request Oct 14, 2026
Retain unresolved process identity and launch evidence through retryable cleanup. Share capture path normalization and preserve failed filesystem observations. Bound child output and drain Windows pipes without one-chunk throttling.

Reviewed fixes include #1628, #2632, #2644, #2784, #2928, #2931, #2965, #2992, and #3011.

Validation: 92 focused source tests passed; four platform-specific skips. Real Windows and Hopper lifecycle coverage was not rerun.
@CassieFox23

Copy link
Copy Markdown
Contributor

Heads up: main already has this change in 599a8ee. The code is in scripts/lib/clean-linux-hopper-runtime.mjs, and does not treat runtime names in another process's arguments as a runtime covers it. It is listed on tracker #3582. If this PR still adds something main doesn't have, please say so here and I'll take it off the list. Thanks for the fix!

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

# Conflicts:
#	tests/process-global/cleanLinuxHopperRuntime.test.ts
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Merged latest main into this branch to resolve the tests/process-global/cleanLinuxHopperRuntime.test.ts conflict. No rebase or force-push was used. Main now exposes the fixture's /proc entries (cmdline, comm, exe) under the supplied proc root in both modes, which covers this PR's alternate-mode-only setup, so the conflict takes main's version. This PR's clean-linux-hopper-runtime.mjs changes and its tests/boundary/process/cleanLinuxHopperRuntime.test.ts merged cleanly. Validation: typecheck and lint pass via the pre-push hook. Both Hopper runtime test files are Linux-only and were skipped on this macOS host (16 skipped), so Linux CI is the real check.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Closing as already integrated in main. Commit599a8ee11 incorporated the runtime-observer behavior and regressions. Against freshly fetched main2092f90b7e0e4c05b473850d059cc1e37914b418, this PR head98b87e7fd99ddf81c009f979fcc6e584418e7d6b has an empty three-dot diff, and its four observer/declaration/test paths are byte-identical to main.

Executed Linux validation: npm run test:focused -- tests/boundary/process/cleanLinuxHopperRuntime.test.ts tests/process-global/cleanLinuxHopperRuntime.test.ts —16/16passed, including real procfs arguments, reparented helpers/alternate launcher, Python option/forwarding controls and unreaped processes. The completed command including runtime preparation took28.96s wall/47.14s reaped CPU/3.17GiB sampled family RSS on two CPUs. Detection remained observation-only. This is current process-boundary verification, not a new full Hopper installation/native E2E claim. The stale review thread is resolved with the producing-fixture explanation.

There is no remaining patch to merge and no new commit is needed.

@N0zoM1z0 N0zoM1z0 closed this Oct 17, 2026
muhamadwijaya pushed a commit to muhamadwijaya/rea that referenced this pull request Nov 11, 2026
…elf-tuning, reports, benefits (v3.0)

- Brand: app renamed SHARX INVEST (SharxInvest.exe), provided logo and icon,
  navy morluto#2644 and fin lime #99FF00 theme; data folder moved to
  %LOCALAPPDATA%\SharxInvest with a one-time copy of the old files.
- Virtual trading ("AI training"): causal SMC strategy (break -> order block
  limit entry, ATR stop, liquidity or fixed-RR target, never below 1:1),
  signal lifecycle with timestamps and auto-cancel rules, SQLite journal,
  live + walk-forward accuracy, per asset/timeframe tuner that adopts new
  parameters only when the out-of-sample Wilson lower bound improves with
  positive expectancy; versioned upgrade log; tuned pivots feed the chart and
  screener; measured accuracy weights the AI x SMC confluence. AI TRAINING
  page and a PLAN tab with signal times, cancel rules and track record.
- Company reports (LAPORAN tab): valuation, analysts, earnings surprises,
  annual/quarterly income, balance sheet, cash flow, shareholders with share
  counts; the compact view also goes to the AI facts.
- DIVIDEN & BENEFIT tab per market: announced or projected ex-dividend dates
  (dividends captured from the daily downloads), halvings, rate decisions and
  benefit headlines classified per market, each with a hype read.
- Crypto universe: top 1,000 CoinGecko coins available on Yahoo (incl.
  numbered tickers), wrapped/staked/tokenized-stock duplicates excluded,
  CoinGecko categories; tagger guards for word-like tickers and coin names.
- Realtime news: every feed polled on its own loop and pushed immediately;
  the list inserts new items without a banner.
- Screener 1M/5M/10M/15M; AI confluence uses the SMC timeframes of the AI's
  horizon. Orbs render every frame (60 fps meter), a zoomed orb grows to the
  whole panel; asset map green/yellow/red.

BREAKING CHANGE: the executable is now SharxInvest.exe and the data folder
%LOCALAPPDATA%\SharxInvest; recreate the desktop shortcut with
buat-shortcut.bat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F1Lkas5GK7XkAkZeX19xUU
@morluto morluto added area: runtime Process capture and runtime observation provider: hopper Analysis provider / engine: hopper labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: runtime Process capture and runtime observation bug Something isn't working P2: medium Medium priority issue provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants