Skip to content

feat(native): retain LLDB source coordinates and verify Pascal calls - #2800

Merged
morluto merged 17 commits into
mainfrom
codex/review-fixes-pr-2400
Nov 7, 2026
Merged

morluto merged 17 commits into
mainfrom
codex/review-fixes-pr-2400

Conversation

@morluto

@morluto morluto commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Native call observations retain compiler-provided source file, line and column coordinates. The Pascal CLI/MCP verifier checks the expected caller frame and compares its source coordinates as well as call-entry facts; compiler invocations have finite deadlines.

The verifier now supervises CLI and MCP process families under the workspace owner. Cancellation waits for process cleanup before removing the workspace, retains failed cleanup for retry, and preserves a prior work failure. Shared MCP transport supervision joins late startup and concurrent close while retaining the existing JADX exit behavior.

Original implementation by @matbrgz in #2400. The original fork rejected the maintainer push with HTTP 403, so this branch provides the requested replacement.

Validation on Node 24.22.1: npm run build:cached, npm run check:fast, and four focused process/MCP/transport suites passed (25 tests), including real subprocess-family cleanup, cancellation during final MCP cleanup, and work-failure precedence. These ran before a subsequent clean merge of unrelated main changes. An initial build attempt under Node 26 failed because its TypeScript loader rejects transform mode; the pinned Node 24 build passed. Real LLDB/Free Pascal and native Windows runs were not performed; existing provider verification is historical.

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T15:09:55.145459Z 9a5977a 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

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The changes reach native-call observations and two MCP process workflows.

Fix the failed-command output mismatch before merging; it breaks the existing Apple verification workflow.

Fix All in CodexFindings

  1. P1 Apple verification loses failed output ▶
Fix with agent prompt
### Issue 1
scripts/lib/artifact-e2e.mjs:131-134
Switching to `owner.exec` breaks `verify:apple-dispatch`. `VerifierCommandExitError` keeps output in `snapshot.stdout.text`, but `scripts/verify/apple/dispatch.mjs` still reads `cause.stdout`. Its malformed-metadata checks now call `JSON.parse(undefined)` and stop before the MCP comparison.

Update that caller to use the new error shape, or preserve the helper’s previous output fields.

---

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

Summary

Retains LLDB source coordinates on call entries, caller frames, and breakpoint locations. Adds Pascal CLI/MCP verification and shares process ownership across verifier commands and MCP transport cleanup.

  • Native call records now keep LLDB's source coordinates.
  • A macOS verifier checks Pascal calls through the CLI and MCP.
  • Verifier and JADX MCP processes now close under one process owner.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  V[Pascal verifier] --> O[Shared command owner]
  O --> C[Compiler and CLI]
  O --> T[Owned MCP transport]
  C --> S[Wait for shutdown]
  T --> S
  S --> Q{Cleanup confirmed?}
  Q -->|Yes| W[Remove workspace]
  Q -->|No| R[Retain owner and workspace]
Loading

Reviews (16) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread scripts/verify-native-pascal-calls.mjs Resolved
Comment thread scripts/verify-native-pascal-calls.mjs Resolved
Comment thread bridge/native/test_rea_lldb_tracer.py Resolved

@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: b4c342eca1

ℹ️ 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

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

The timeout sent SIGTERM, which a selected compiler wrapper could ignore. Both compiler probes and compilation now request SIGKILL at their existing finite deadlines, so the direct compiler process cannot ignore timeout termination and the existing finally owns temporary cleanup. No directly related source cleanup remains.

Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: b4c342e

  1. thread 1

Expected caller coordinates duplicated physical fixture line numbers. The Pascal fixture now carries unique loop/call markers, and the verifier derives both expected lines from the selected source while requiring each marker exactly once. Source-coordinate comparison remains strict without coupling it to preceding whitespace. No directly related source cleanup remains.

Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: b4c342e

  1. thread 1

The aggregate location budget regression used only absent line entries. It now covers both that case and valid line entries with a large Unicode source path, counts serialized source metadata in the retained-byte budget, and asserts the path survives in retained locations. No directly related source cleanup remains.

Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: b4c342e

@morluto morluto added enhancement New feature or request area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: bridge Hopper bridge (Python) related changes area: domain Domain logic, errors, and pure functions 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: 976c3990d6

ℹ️ 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".

Comment thread scripts/verify-native-pascal-calls.mjs Resolved
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

Fixed publicly in 976c399. The verification page presented earlier checks as current evidence even though later assertions, timeout termination, and Unicode budget changes were not run. It now labels those records historical and states exactly which final behavior remains unverified. Source and documentation inspection plus git diff --check passed; automated checks and provider execution were skipped at the user request. No related source cleanup remains.

review thread

The verification record now explicitly says repeated paths expand serialized payloads and that no equivalent cold or warm measurements exist for agent tokens, elapsed time, CPU time, or peak process-family memory. Those measurements require completed representative workflows, which the current user instruction forbids running. This is an honest hold: do not integrate the repeated source-location expansion until the requested measurements are completed. The limitation is documented in 976c399; source review and git diff --check passed, but no execution or performance proof is claimed.

@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: 1ac8ab8771

ℹ️ 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

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

The LLDB source_location field now advertises the caveat and every observe_native_calls result includes it in limitations: paths/lines are LLDB line-table attribution, not proof that REA read or verified those source bytes. This is live at 1ac8ab8. Pinned formatting and git diff --check passed; tests and provider runs were not performed.

review thread

The verifier now launches each caller-selected FPC invocation in an owned detached process group; timeout kills the group, and execFile completion is awaited before the finally block removes temporary output. This is live at 1ac8ab8. Pinned formatting and git diff --check passed; the verifier/provider workload was not run.

@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: 0d3e0a87ef

ℹ️ 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".

Comment thread scripts/verify-native-pascal-calls.mjs Resolved
Comment thread scripts/verify-native-pascal-calls.mjs Resolved
@morluto
morluto force-pushed the codex/review-fixes-pr-2400 branch from 0d3e0a8 to 856ea92 Compare October 13, 2026 18:27
matbrgz and others added 7 commits October 14, 2026 02:40
…ntries

Preserve partial line-table attribution for native locations and historical
evidence compatibility. Verify owned Free Pascal call entries through CLI/MCP.

Refs #2382, #2372, #2397

Co-Authored-By: Codex <[email protected]>
Use stable descriptive paths instead of numeric prefixes to avoid parallel contribution collisions.

Co-Authored-By: Codex <[email protected]>
Address review findings at their producing boundaries and preserve directly affected consumers. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request.
@morluto
morluto force-pushed the codex/review-fixes-pr-2400 branch from 856ea92 to 4a9883b Compare October 13, 2026 18:40

@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: ca7e980d49

ℹ️ 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".

Comment thread scripts/verify-native-pascal-calls.mjs Resolved
Comment thread scripts/verify-native-pascal-calls.mjs Resolved
# Conflicts:
#	bridge/native/test_rea_lldb_tracer.py
@kaoru0822-kitauji

kaoru0822-kitauji commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Merged latest main into this branch. No rebase or force-push was used. The bridge/native/test_rea_lldb_tracer.py conflict keeps both new tests: main's test_pre_target_integrity_failure_reports_no_process_created and this PR's test_source_coordinates_preserve_partial_metadata_without_reading_source. After the merge, main's typecheck covers tests/boundary/filesystem/nativePascalVerifier.test.ts. It failed on the untyped scripts/lib/canonical-temporary-directory.mjs import and an unknown catch value, so a follow-up commit adds canonical-temporary-directory.d.mts and narrows the caught error. Validation: python3 -m unittest test_rea_lldb_tracer (11 passed), nativePascalVerifier.test.ts (2 passed), and typecheck and lint via the pre-push hook.

Main now typechecks this boundary test, which imports the untyped
canonical-temporary-directory helper and reads an unknown catch value.
Add the helper's declaration file and narrow the caught error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread scripts/verify-native-pascal-calls.mjs Resolved
Comment thread scripts/verify-native-pascal-calls.mjs Resolved
morluto and others added 4 commits October 29, 2026 07:57
CLI and MCP artifact runs observe the verifier abort signal, and a
failed Pascal verifier test stops the compiler group before deleting
its directory. Repeated source locations grow by measured UTF-8 JSON
bytes; workflow tokens, CPU and peak memory stay unmeasured.
Comment thread scripts/lib/artifact-e2e.mjs Resolved
@morluto
morluto merged commit 3e8a5f7 into main Nov 7, 2026
15 of 17 checks passed
@morluto
morluto deleted the codex/review-fixes-pr-2400 branch November 7, 2026 15:25
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
Comment on lines +131 to +134
const owner = commands ?? (await createVerifierCommands());
const execute = () =>
owner.exec(
process.execPath,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Apple verification loses failed output

Switching to owner.exec breaks verify:apple-dispatch. VerifierCommandExitError keeps output in snapshot.stdout.text, but scripts/verify/apple/dispatch.mjs still reads cause.stdout. Its malformed-metadata checks now call JSON.parse(undefined) and stop before the MCP comparison.

Update that caller to use the new error shape, or preserve the helper’s previous output fields.

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/lib/artifact-e2e.mjs
Line: 131-134

Comment:
**Apple verification loses failed output**

Switching to `owner.exec` breaks `verify:apple-dispatch`. `VerifierCommandExitError` keeps output in `snapshot.stdout.text`, but `scripts/verify/apple/dispatch.mjs` still reads `cause.stdout`. Its malformed-metadata checks now call `JSON.parse(undefined)` and stop before the MCP comparison.

Update that caller to use the new error shape, or preserve the helper’s previous output fields.

---

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

Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: bridge Hopper bridge (Python) related changes area: domain Domain logic, errors, and pure functions area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request P2: medium Medium priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants