Repository navigation
feat(cli): report version and runtime with an explicit output format - #6530
Conversation
`rea --version --json` and `--version --format <format>` ignored the format and printed only the bare version, so support reports gathered the runtime and platform by hand. A root --version request that selects a format now renders a documented report: package name and version, JavaScript runtime and version, platform, architecture, and whether the runtime satisfies the supported range. It contains no paths, environment values, user or host names, and starts no provider. Plain --version is unchanged, --help keeps precedence, and other output controls keep Incur's plain version. The runtime verdict uses a new shared supportsJavaScriptRuntime rule that rea doctor now uses too, so both judge Bun by its Node.js compatibility version. mcp doctor's private JSON/format renderer moves to cliOutput as renderCliDocument and is shared with the version report. Closes morluto#5483
Carry caller messages through the existing schema issue owner instead of constructing and discarding an intermediate input error. Remove forwarding schema helpers and migrate equivalent constructors across investigation, firmware, dylib, process, and screenshot workflows while preserving diagnostic paths and causes.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
* docs(readme): add Roman Urdu edition Register ur-Latn with a pending website catalog and preserve English command examples. Script-tag handling follows morluto's shared helper proposed in PR morluto#2043 (c46f606). * test(website): cover completed script-tag page metadata
[High impact] The PR reaches many analysis workflows and changes the public package-release path. The PR should not merge until ELF parsing work is bounded and repeated-slash item calls can find their stored entities. Findings
Fix with agent prompt### Issue 1
src/native/exports/NativeExportParser.ts:384-397
The new ELF version walk checks byte ranges but has no total work limit. Records can share auxiliary rows: a roughly 2 MiB table can trigger 4,294,901,760 inner-loop visits while passing the range and forward-offset checks. `NativeExportsProvider` runs this synchronously, so a crafted file can freeze the CLI or MCP server and block cancellation. Add a shared work budget or reject overlapping chains in both version-table walks.
**How this was verified:** A caller-selected ELF reaches a synchronous walk that can repeatedly revisit shared rows while every checked byte range remains inside the file.
### Issue 2
src/domain/analysisView/environmentStateRules.ts:210-215
`segmentsOf` now preserves internal empty segments, but `callSegments` still drops them. For a captured item route such as `/api//books/1`, extraction stores the entity under `/api//books`, while its tool call searches with `["api", "books"]`. `collectionMatch` rejects that mismatch, and `answerItem` reports the existing entity as missing. Make capture-time and call-time path splitting preserve the same segments, and cover a served item call rather than only extracted type names.
### Issue 3
src/application/environment/environmentCompareDiff.ts:260-267
ID-list mapping now happens only in `sameItems`. When one item changes or the list length differs, that check fails and `array` compares individual values without their field name. `scalar` then skips the ID mapping. For example, with `101 → 1` and `102 → 2`, comparing `{"ids":[101,102]}` with `{"ids":[1,9]}` wrongly reports a difference at `/ids/0` as well as the real change at `/ids/1`. Carry the ID-list context into the element comparisons so unchanged IDs stay matched.
### Issue 4
src/dotnet/ManagedMemberInspectorCore.ts:947-948
New invalid type-operand issues copy a blob-relative offset directly into `coverage.issues`. For the added field-signature fixture `[0x06, 0x12, 0x07]`, the reported offset is `2`, not the operand’s position in the selected PE file. `readMetadataBlob` returns a slice, so the file position is available from its byte offset. Add that base when publishing these issues, as `validateLocalSignature` already does, so users can locate the bad byte.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds explicit-format version reports and avoids loading analysis commands for those reports. The full diff also changes environment serving and comparison, binary/archive readers, release publication, and translations.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI arguments] --> B[Normalize arguments and check settings]
B --> C{Explicit-format version request?}
C -->|Yes| D[Build package and runtime report]
D --> E[Shared document formatter]
E --> F[stdout]
C -->|No| G[Load CLI commands]
G --> H[Run Incur]
H --> F
Reviews (3) · Last reviewed commit: "perf(cli): avoid loading analysis comman..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e1326ced5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The CLI test rejected any report containing the OS account name, so an account named node, linux or rea failed a correct report. Check unique caller-controlled HOME, cwd and environment markers instead; the strict schema still rejects any additional field. The CLI guide said --version with other output controls prints the plain version, but invalid combinations such as --json with --token-limit report their existing output-flag error first. Describe both outcomes and test them.
Centralize parse-wide identity and coverage facts while keeping conservative admission values separate from measured rows and counters. Reuse the derived truncation reason and retain the final serialization bound. Tighten the report-budget regression so unexpected parser finalization errors cannot be swallowed by its budget search.
Share expected and observed check construction across MZ, COM, and raw-binary attestations. Preserve format-specific rules and source coordinates, and derive mapping callback types from the recording owner.
Parse complete nonzero Activity Manager reports while preserving other command failures and their captured output. Admit dollar signs only in the activity component name for nested Android classes. Fixes morluto#6528 Fixes morluto#6527
Project PYZ namespace packages as metadata so their query paths do not claim output directories. This lets independent CArchive files retain the same logical path and remain inspectable and extractable. Fixes morluto#6539
baron
left a comment
There was a problem hiding this comment.
AI-assisted review traced fixed version-report fields, root-flag/format precedence, launcher admission, shared doctor rendering and resolved marker/fallback findings. No blocking feature defect found. Exact-head build, 50 selected source/dispatcher cases and the compiled public version-report test passed locally; this includes privacy markers, YAML/plain-version behavior and filter/help precedence. Filtered-out tests are not counted as executed.
I requested one rerun of hosted CI 39923240735. Its original Hopper process-lifecycle and firmware-fixture failures are retained and not proven transient/baseline. Approval remains withheld pending completed required hosted gates. No real Bun or real-TTY end-to-end coverage, full-suite local pass or new provider behavior is claimed.
Share bounded ELF section-name decoding across native and note readers; retain read-only ranges and coverage reasons when names are unknown. Preserve ELF symbol-version bytes, dyld-bound method uncertainty, partial gRPC-Web trailers, and per-parent model identity checks. Compare GPU signatures as bytes and require a PTX module header. Share selected-path errno classification across EVM and BEAM. Validation: 397 shared-parser tests passed (one existing skip), 5 MCP schema tests passed, 14 EVM error-mapping tests passed, and 23 protobuf CLI/MCP matrix cases passed across focused runs. Build, typecheck/lint, docs, formatting, and 2134-file discovery passed. Full EVM provider workflow remains locally unverified on Darwin arm64; format controls are synthetic. Fixes morluto#6738 Fixes morluto#6737 Fixes morluto#6745 Fixes morluto#6740 Fixes morluto#6749 Fixes morluto#6747 Fixes morluto#6739
…orluto#6401) * fix(setup): keep the CLI-only skill choice offered under a client ID * test(setup): cover the accept-all CLI-only skill selection
…al (morluto#6479) * fix(apple): report a read-denied selected archive as host access denial inspect-keyed-archive reported a host read refusal on the caller-selected bundle entry as artifact_operation_failed/execution_failure with reason io, leaving EACCES or EPERM only inside message text. The caller selected that entry, so the refusal is a selection outcome with its own typed classification, system code and read-access recovery. DirectoryArtifactReader now marks a refused entry open with DirectoryArtifactEntryAccessDenied, which retains the host system code and the selected entry path. KeyedArchiveReader, which owns the caller's selection, maps it to the shared AnalysisAccessDeniedError, and artifact failure translation keeps that typed error instead of replacing it with a generic io failure. Other readers and other reader failures are unchanged; every existing reason keeps its current projection. Adds the access_denied projection coverage plus a real host refusal through the production reader and a non-permission control. * fix(apple): carry cleanup ownership and cover raw refusals for a denied selection Addresses the two review findings on the denied-selection classification: - The typed host access denial now carries the reader's cleanup observation, so a denied open that left a resource owned does not project as fully cleaned. - Adds coverage that starts from raw host EACCES/EPERM/EIO refusals with the real DirectoryArtifactReader open path, so the marker itself is exercised rather than constructed by the test. EIO stays an artifact failure.
…on failures (morluto#6371) Co-authored-by: Abelo9996 <[email protected]>
…ates (morluto#6253) * fix(doctor): check only the current platform's Hopper launcher candidates Doctor built one launcher list for every platform, so on macOS it could report a Linux-only path as a healthy Hopper ahead of a renamed bundle, and setup then registered that path. Give per-platform automatic candidates one owner that runtime configuration and doctor both read, scan renamed macOS bundles and probe the Homebrew cask only on macOS, and share runtime's renamed-bundle scan with the doctor host. Fixes morluto#6228 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(doctor): keep the renamed Hopper bundle scan asynchronous Sharing runtime's synchronous scan made the doctor host read ~/Applications with readdirSync, which blocks the event loop on a slow or network-mounted home. Give MacHopperPaths an asynchronous scan for doctor beside runtime's lazy synchronous one, sharing the directory filter and candidate builder, and check that both return the same candidates. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(doctor): model renamed launchers with runtime's POSIX joins Since morluto#5235, runtime builds macOS launcher paths with posix.join, so on Windows the discovery table's native-join renamed launcher no longer matched runtime's candidate. Model launchers with posix.join and keep filesystem setup native, as MacHopperPaths.test.ts does. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…to#6495) Fixes morluto#6482 Co-authored-by: Abelo9996 <[email protected]>
…uto#6327) A projection wider than SQLite's native result-column limit failed with the generic "too many columns in result set" SQL error. The inspector could not attribute that error to a generated column, so the worker reported "format" and the parent blamed the caller's path as invalid_format even though the selected database was readable. Classify the refusal from SQLite's own column limit for the private connection, carry the selected and engine counts through the worker reply, and project it as a capacity resource constraint. The database stays readable, no partial rows are returned, and the recovery names the column counts and splitting the projection across calls.
…ut (morluto#6313) * fix(web): refuse an existing script-export destination as invalid input export_web_scripts refused an existing output directory or link correctly, but reported it as artifact_operation_failed / execution_failure with no field issue or recovery. SafeOutputTree.create raises that refusal as a path failure before any output tree exists, and the export mapper wrapped it as an artifact failure. Attribute pre-admission path refusals to output_directory as an AnalysisInputError, as environment export already does for its directory. Both now share one helper owned beside SafeOutputTree; failures after the tree is admitted keep their artifact semantics. Fixes morluto#6029 * fix(artifacts): type SafeOutputTree destination refusals Admission conversion treated any cleanup-free path failure raised before admission as a refusal of the selected directory, so an acquired-tree setup failure, such as being unable to restrict a created root to 0700, blamed valid output_directory or directory input. SafeOutputTree.create now raises SafeOutputTreeDestinationRefusal for the refusals of the selection itself: a relative or reserved root, an existing root, and an accepted existing root that is not an empty directory. The shared conversion accepts only that type, directly or wrapped by SafeOutputTreeCreationFailure, so script and environment export no longer track admission separately.
…o#6230) * fix(evm): reject repeated container keys in Solidity metadata * test(evm): check the repeat-key diagnostic for deeply nested keys
* docs(ci): add a repeatable static analysis example * fix(ci): isolate example reports and repair the guide link --------- Co-authored-by: gongfpp <[email protected]>
Retain bounded FAT and offset-tagged PE observations through archive hashing, classification, and content nodes. Preserve PyInstaller member paths according to the observed carrier dialect and share APK v1 signing-name semantics. Read SQLite's implicit sqlite_schema table without inventing a stored schema declaration. Distinguish unsupported ELF numbering and decoded-name admission from malformed data and fixed scan allowances. Preserve Sigrok basenames and classify matching explicit input-format refusals at their owning boundary. Validation: 554 distinct tests passed, 3 skipped across serial focused runs; build, typecheck/lint, docs, formatting, and discovery (2141 files) passed. Sigrok command-boundary simulators do not establish real-tool decoding. Small repeated public PyInstaller CLI runs had equivalent inventory facts; warm median elapsed 0.5431s before / 0.5426s after, with no speed claim. Fixes morluto#6733 Fixes morluto#6741 Fixes morluto#6722 Fixes morluto#6732 Fixes morluto#6736 Fixes morluto#6734 Fixes morluto#6764 Fixes morluto#6766 Refs morluto#6739
Use zip.js's parsed symlink fact for inventory and open refusal. Treat an unmatched Godot trailer as an unconfirmed candidate while preserving failures for confirmed malformed packs. Report entropy path-resolution failures at the selected-input boundary. Separate Go header discovery from inline string extents in ELF and Mach-O, and apply the aggregate content allowance after validating real source ranges. Normalize binary plist UID widths through the existing scalar-copy owner, budget exact clone growth, preserve source identity, and refuse inexact UIDs. Validation: 389 distinct tests passed, one Linux /proc test skipped on Darwin; build, typecheck/lint, docs, single-thread formatting, and discovery (2142 files) passed. CLI/MCP Go fixtures and public ZIP/Godot/keyed-archive workflows ran. Real producer prevalence and external provider execution were not established. Repeated ordinary keyed-archive CLI inventory facts and estimated reply tokens were equal before/after. Warm median elapsed was 0.5166s / 0.5177s; no speed claim. Fixes morluto#6751 Fixes morluto#6763 Fixes morluto#6754 Fixes morluto#6767 Fixes morluto#6762 Fixes morluto#6779
|
CI source-test failures are baseline failures, verified against the exact revisions used by the failed job.
The same failures are:
The PR changes none of these owners/tests. No unrelated fix is included. These four baseline failures are eligible for the explicitly authorized bypass; other CI failures and current-head review findings still require attribution before merge. |
| let auxiliary = offset + auxiliaryOffset; | ||
| for (let item = 0; item < auxiliaryCount; item++) { | ||
| if (auxiliary + 16 > table.size) | ||
| throw new BinaryFormatFailure( | ||
| "malformed", | ||
| "Version requirement auxiliary chain leaves its section", | ||
| ); | ||
| const auxAt = table.offset + auxiliary; | ||
| const versionIndex = reader.u16(auxAt + 6) & 0x7fff; | ||
| const auxiliaryNext = reader.u32(auxAt + 12); | ||
| try { | ||
| addName( | ||
| versionIndex, | ||
| readElfStringBytes(names, reader.u32(auxAt + 8)), |
There was a problem hiding this comment.
The new ELF version walk checks byte ranges but has no total work limit. Records can share auxiliary rows: a roughly 2 MiB table can trigger 4,294,901,760 inner-loop visits while passing the range and forward-offset checks. NativeExportsProvider runs this synchronously, so a crafted file can freeze the CLI or MCP server and block cancellation. Add a shared work budget or reject overlapping chains in both version-table walks.
How this was verified: A caller-selected ELF reaches a synchronous walk that can repeatedly revisit shared rows while every checked byte range remains inside the file.
Knowledge Base Used: Binary diagnostics and comparison
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/native/exports/NativeExportParser.ts
Line: 384-397
Comment:
**ELF inspection can freeze**
The new ELF version walk checks byte ranges but has no total work limit. Records can share auxiliary rows: a roughly 2 MiB table can trigger 4,294,901,760 inner-loop visits while passing the range and forward-offset checks. `NativeExportsProvider` runs this synchronously, so a crafted file can freeze the CLI or MCP server and block cancellation. Add a shared work budget or reject overlapping chains in both version-table walks.
**How this was verified:** A caller-selected ELF reaches a synchronous walk that can repeatedly revisit shared rows while every checked byte range remains inside the file.
**Knowledge Base Used:** [Binary diagnostics and comparison](https://app.greptile.com/pre/-/custom-context/knowledge-base/morluto/rea/-/docs/binary-diagnostics-and-comparison.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| export const segmentsOf = (path: string): string[] => { | ||
| const segments = path.split("/"); | ||
| if (segments[0] === "") segments.shift(); | ||
| if (segments.at(-1) === "") segments.pop(); | ||
| return segments; | ||
| }; |
There was a problem hiding this comment.
Repeated slashes hide existing items
segmentsOf now preserves internal empty segments, but callSegments still drops them. For a captured item route such as /api//books/1, extraction stores the entity under /api//books, while its tool call searches with ["api", "books"]. collectionMatch rejects that mismatch, and answerItem reports the existing entity as missing. Make capture-time and call-time path splitting preserve the same segments, and cover a served item call rather than only extracted type names.
Knowledge Base Used: Environment bundle and replay
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/analysisView/environmentStateRules.ts
Line: 210-215
Comment:
**Repeated slashes hide existing items**
`segmentsOf` now preserves internal empty segments, but `callSegments` still drops them. For a captured item route such as `/api//books/1`, extraction stores the entity under `/api//books`, while its tool call searches with `["api", "books"]`. `collectionMatch` rejects that mismatch, and `answerItem` reports the existing entity as missing. Make capture-time and call-time path splitting preserve the same segments, and cover a served item call rather than only extracted type names.
**Knowledge Base Used:** [Environment bundle and replay](https://app.greptile.com/pre/-/custom-context/knowledge-base/morluto/rea/-/docs/environment-bundle-and-replay.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const mapped = live.map((item) => { | ||
| if ( | ||
| (typeof item === "string" && this.map.isStateReference(item, field)) || | ||
| ((typeof item === "number" || typeof item === "string") && | ||
| ID_LIST_FIELD.test(field)) | ||
| ) | ||
| return translateValue(item, this.map); | ||
| return item; |
There was a problem hiding this comment.
ID-list mapping now happens only in sameItems. When one item changes or the list length differs, that check fails and array compares individual values without their field name. scalar then skips the ID mapping. For example, with 101 → 1 and 102 → 2, comparing {"ids":[101,102]} with {"ids":[1,9]} wrongly reports a difference at /ids/0 as well as the real change at /ids/1. Carry the ID-list context into the element comparisons so unchanged IDs stay matched.
Knowledge Base Used: Environment bundle and replay
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/environment/environmentCompareDiff.ts
Line: 260-267
Comment:
**Unchanged IDs appear changed**
ID-list mapping now happens only in `sameItems`. When one item changes or the list length differs, that check fails and `array` compares individual values without their field name. `scalar` then skips the ID mapping. For example, with `101 → 1` and `102 → 2`, comparing `{"ids":[101,102]}` with `{"ids":[1,9]}` wrongly reports a difference at `/ids/0` as well as the real change at `/ids/1`. Carry the ID-list context into the element comparisons so unchanged IDs stay matched.
**Knowledge Base Used:** [Environment bundle and replay](https://app.greptile.com/pre/-/custom-context/knowledge-base/morluto/rea/-/docs/environment-bundle-and-replay.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| if (cause.issue.code === "invalid-row") | ||
| issueSink?.({ ...cause.issue, scope }); |
There was a problem hiding this comment.
Signature errors point elsewhere
New invalid type-operand issues copy a blob-relative offset directly into coverage.issues. For the added field-signature fixture [0x06, 0x12, 0x07], the reported offset is 2, not the operand’s position in the selected PE file. readMetadataBlob returns a slice, so the file position is available from its byte offset. Add that base when publishing these issues, as validateLocalSignature already does, so users can locate the bad byte.
Knowledge Base Used: Binary diagnostics and comparison
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/dotnet/ManagedMemberInspectorCore.ts
Line: 947-948
Comment:
**Signature errors point elsewhere**
New invalid type-operand issues copy a blob-relative offset directly into `coverage.issues`. For the added field-signature fixture `[0x06, 0x12, 0x07]`, the reported offset is `2`, not the operand’s position in the selected PE file. `readMetadataBlob` returns a slice, so the file position is available from its byte offset. Add that base when publishing these issues, as `validateLocalSignature` already does, so users can locate the bad byte.
**Knowledge Base Used:** [Binary diagnostics and comparison](https://app.greptile.com/pre/-/custom-context/knowledge-base/morluto/rea/-/docs/binary-diagnostics-and-comparison.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Additional CI/review attribution for head
The authorized bypass covers these demonstrated baseline failures and their fail-fast cancellations/aggregate status consequences. No unrelated repair is included in the version-report feature. |
|
Correction to the CI accounting: the merged portable report contains 9 failing cases, not the 6 listed in my earlier attribution comments. Three failures had been emitted by shards that were later cancelled; I initially missed those before sending the merge request. I have now executed the additional cases against separately built CI main
The same assertion failures occur in both revisions; no resource guard was reached. Together with the earlier controls, all 9 observed failures are demonstrated baseline failures. No unrelated source repair is included. The six fail-fast cancellations still leave incomplete broad-suite coverage; this is not a green-CI claim. PR #6530 merged as |
Summary
Closes #5483.
rea --version --jsonor an explicit--formatreturns package version, runtime identity/support, platform and architecture. Plain--versionkeeps its existing output; help and other output controls retain their documented handling.The launcher now handles formatted versions before loading analysis commands. Global setting validation has one lightweight owner shared by the launcher and compiled CLI drivers;
mcp doctorand version reports share document rendering. No target interaction, provider prerequisite, new MCP tool, or additional runtime bundle entry is introduced.Validation
Linux x64, pinned Node 24.22.1 / npm 11.16.0:
npm run checkandnpm run docs:checkpassed (including 9 README consistency tests).supported_runtime: false; this is not Node 20 analysis support.Executed methods, source/build identities, measurements and limitations.
One earlier parallel selection had 209 passes and one existing 3000 ms process deadline failure. The later serial 231-test selection passed without changing deadlines; the failed attempt is retained and its cause is not conclusively attributed. Bun, macOS and Windows end-to-end behavior was not run.
Hosted CI completed with 9 demonstrated baseline-only failing cases, all reproduced on its exact main parent and merge revision. Complete attribution and correction. Fail-fast cancellations and aggregate failures leave incomplete broad-suite coverage; this is not a green-CI claim. Four Greptile findings target unchanged baseline blobs and remain open, while Codex completed current-head review without findings. Merge used the explicit baseline-failure bypass authorization; no unrelated repair is included.
Author readiness
Human owner: @mhamzasakhi