Three formats had their own error mappers that still reported a selected
file's corrupt bytes as an invalid_format path issue (invalid_request):
managedInspectionInputFailure, Il2cppMetadataProvider and the Mach-O slice
selection mappers. Each now projects its format owner's own failure through
AnalysisMalformedTargetError at the path of the file whose bytes are at fault.
- Managed PE/CLI: a broken rule is a malformed pe-cli target with the
reader's scope and offset; unsupported-metadata and unsupported-signature
are unsupported targets; resource limits stay with their producer.
- Universal Mach-O: the container reader raises a ParseFailure once
(malformed, truncated where it measured the end, unsupported from the
container's own category), and requireSelectedNativeImage(FromReader)
project it at the universal file's path. An unknown or ambiguous
architecture stays invalid_request on the architecture field.
SliceSelectionInput.pathField is removed.
- IL2CPP: metadata and binary format failures each name their own file. A
binary that parses but does not link to the metadata is a link conflict:
invalid_request with invalid_value issues on both path and binary_path,
no input-contract recovery, and the partial observation keeps both file
identities. Neither file is called malformed.
BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries, compare_managed_members,
inspect_il2cpp_metadata, inspect_go_binary, inspect_rust_binary,
inspect_dwarf_units and inspect_native_initializers report corrupt or
truncated target bytes as code unsupported_target with details.path,
format, format_failure and reason instead of invalid_request with an
invalid_format issue. IL2CPP link conflicts list both path and binary_path
with reason invalid_value instead of one invalid_format binary_path issue.
* refactor(cli): run one-shot commands through one shared owner
scripts/rea.mjs and the test CLI session worker each implemented the
one-shot command sequence: argument normalization, output admission,
configuration errors, version documents, the Amp scope refusal, and
result delivery. The worker copy had drifted: it never rendered
formatted version reports or the Amp refusal.
Move the sequence into src/cliOneShot.ts. Both callers supply a host
for their streams, exit and resource ownership. The launcher keeps
closed-pipe status, worker shutdown and process exit; the session
worker captures output per command.
The cliOutput bundle entry is superseded and removed. The dispatcher
test now replaces only the command runtime, so output admission runs
production code. A new parity test compares the file session with a
fresh process.
* test(cli): bundle the one-shot entry in the runtime bundle fixture
* perf(tests): run plain CLI commands on the file's shared process
`cli.run` in `cliTest` files started a fresh compiled CLI for every
command, about 0.45s and 260 MB each before any work. The file-scoped
session already existed, but callers had to opt in through
`runFileCli` or `sharedCliRun`, so 1,300 call sites still spawned.
Make the fixture choose: `cli.run` uses the shared process when it
reports the command exactly as a fresh process would, and starts one
otherwise (stdin, explicit deadlines, MCP and MCP doctor routing,
NODE_OPTIONS, or enabled logging). `freshProcess: true` keeps
explicit process-level checks. The session worker now presents the
launcher's entrypoint, so registration identity matches a fresh
process.
`runFileCli` and `sharedCliRun` are superseded and removed; their
call sites use `cli.run`, and paired fresh/shared checks use
`freshProcess`.
* style(tests): format the managed member summary call site
* test(cli): give each shared-session command an empty stdin
The shared CLI process reads session frames from its own stdin. A
command that reads stdin without supplied input, such as
`compare-wasm-interfaces - --json`, read that pipe and hung, where a
fresh process receives EOF. The worker now presents an ended, empty
stdin to each command and restores its own afterwards.
The parity test compared the routed path with itself after cli.run
began choosing the session. It now compares a fresh process with the
session directly, including the `mcp add` refusal and a command
reading absent stdin.
* test(cli): keep default command logging and launcher checks on fresh processes
environment-serve and environment-build log at info when REA_LOG_LEVEL is
unset, through a logger that writes to stderr directly. The shared CLI
process captures only process.stderr writes, so routed runs lost those
lines. Declare the default-logging commands beside the command names,
have infoLogger read that set, and start a fresh process for them.
The log-level precedence checks compared the shared process with itself
after routing; their fresh side now passes freshProcess: true.
Explicit deadlines at or below the project deadline only shortened it:
a literal 30-second value also disabled the coverage scaling, which timed
out wide-capacity regressions on main. Workloads above the built
deadline use the long-running tag. Deadlines derived from an operation
budget remain.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>