Commit Graph
10063 Commits
Author SHA1 Message Date
morluto 28541580d6 test(errors): expect path refusals and invariant reasons from shared readers
Non-regular dyld inputs, ZIP sources, artifact roots and directory
entries now raise the path selection reason. An invalid stream chunk
size is an internal invariant violation, and an impossible descriptor
byte count is an I/O failure. Update the process-global and filesystem
boundary expectations that still asserted the old format reason.
2026-11-23 20:24:52 -05:00
morluto 61b4ada453 fix(errors)!: split reader path refusals from malformed target bytes
ArtifactReaderFailure("format") covered two different facts: target
bytes that violate their format, and a selected path that is not a
regular file. The shared selected-file projections
(projectOwnedArtifactInputFailure and classifyProviderFailure's file
step) mapped both to invalid_request with an invalid_format path
issue, so corrupt BEAM files and PE certificate table bodies were
reported as caller argument errors.

Split the reason at its producers:

- Path-kind refusals now use the existing "path" selection reason:
  regular-file admission, the stable root, directory, ZIP, ASAR and
  PyInstaller entries, dyld inputs, the UEFI flash source and extract
  occurrence selection. They stay invalid_request.
- The BEAM parser and the PE certificate table parser raise the format
  owner's ParseFailureError (malformed or truncated, format "beam" or
  "pe-certificate-table"). A short file that does not start with FOR1
  is malformed, not truncated. A PKCS#7 name encoding the decoder does
  not implement is unsupported, not malformed.
- Short reads inside an admitted range (kernel module, kernel build
  config, ELF unwind ranges) are integrity read-coverage failures,
  because the file changed during the read.
- Internal contract breaks (stream chunk size, a non-Buffer keyed
  archive chunk) are invariant violations; an impossible descriptor
  byte count is an I/O failure.

The shared projections now treat only "path" as a selection error.
They take the malformed-target facts from the reader failure's own
parseFailure, which artifactParseFailure sets once from the owner's
ParseFailureError and rebuilt failures keep through primaryFacts.
ArtifactOperationError carries the same facts, so inspect_artifact
refusals (for example Android boot images) now include
details.format_failure, format, offset and field. Android boot entry
planning raises the format owner's malformed failure, and the
redundant shortcut and API-contract format branches are removed.

BREAKING CHANGE: callers that parse `code` see unsupported_target
instead of invalid_request for malformed or truncated bytes from
inspect_erlang_beam and from the inspect_pe_certificates certificate
table body. Truncated reads of a file that changed during
inspect_kernel_module, inspect_kernel_build_config and
inspect_elf_unwind_ranges now report artifact_changed. inspect_artifact
malformed and truncated refusals gain details.format_failure and
details.format. Existing fields are unchanged.
2026-11-23 20:11:49 -05:00
morluto 89c1dd3c32 fix(errors): refuse malformed target bytes as a target, not invalid input (#14195)
* fix(errors): refuse malformed target bytes as a target, not invalid input

parseFailureAnalysisError is the shared owner that turns a byte-format
parser's ParseFailure into a public refusal. It mapped malformed and
truncated bytes to an AnalysisInputError on the path field. The envelope
then reported invalid_request, with inspect_input_contract recovery and
"correct the listed fields". The arguments were valid; the target bytes
were the problem. Readers that wrap the ParseFailureError in an
ArtifactReaderFailure, and ArtifactOperationError reason=malformed, were
classified the same way.

Add AnalysisMalformedTargetError. It keeps the parser's kind, format,
detail, offset and field, and projects as unsupported_target with
details.format_failure. Its recovery is to choose another operation or a
well-formed copy of the target. Route both parser entry points through it
and reclassify ArtifactOperationError reason=malformed. Argument and
selection errors (missing files, directories, symlinks, JSON arguments)
stay invalid_request.

Fixes #14170

* docs(maven): describe duplicate variant names as malformed metadata

Duplicate Gradle variant names go through malformedInput, which now
reports unsupported_target with details.format_failure: malformed.
Point the earlier statement at that section instead of the old
invalid_format code.

* test(errors): expect malformed-target refusals from CLI byte-format readers

Truncated IPS, ELF, PE and shortcut bytes now project as unsupported_target with format_failure=malformed. Update the CLI acceptance cases that still expected invalid_request.

* fix(errors): keep a cancelled read a cancellation whatever its abort reason

projectOwnedArtifactInputFailure read the reader failure's cause without
checking the reader's own reason. A cancelled read carries the caller's
opaque abort reason as that cause, so aborting with a ParseFailureError
turned the cancellation into a non-retryable malformed-target refusal
before the shared cancellation projection ran. Only a reader whose own
reason is malformed or truncated now yields a malformed target.

The ELF dependency checkpoint cancellation test now also aborts with a
parser failure as the reason, through the public provider read.

* test(pe): expect malformed-target refusals from the PE filesystem boundaries

Short non-PE bytes now refuse the target rather than the request field.
The missing-file, directory, symlink and child-path controls keep their
caller-input expectations.

* fix(elf): refuse malformed ELF note bytes as a target, not invalid input

inspect_elf_notes shared this PR's root cause: its parser reported
structural violations as a reader "format" failure, which the shared
stable-artifact projection treats as a request-field error, so truncated
or non-ELF bytes still returned invalid_request. The parser now raises
malformed or truncated ParseFailureErrors, which the shared projection
reports as a malformed target with format_failure and format facts.

Consumers that interpreted the old reader reason now use the parser's
facts: debug-link build-id observation keys on ParseFailureError kinds,
and binary hardening drops its rewrap of note-parser format failures
into BinaryFormatFailure, which the parser's own failure supersedes.

* test(errors): own the byte readers' malformed-target projection in one CLI table

The PR repeated the same malformed -> unsupported_target mapping in a
dedicated CLI test per command and again in each provider's filesystem
boundary test. The stable-artifact parser-failure CLI table now owns it:
every byte reader it covers (now including ELF dependencies, debug link,
unwind ranges and native initializers) refuses a truncated ELF header as
a malformed target with operation, path, format_failure, retained file
identity and no argument recovery.

Removed as redundant with that table: the truncated or non-ELF/non-PE
CLI tests for ELF debug link, dependencies, unwind ranges and notes,
native initializers, and PE imports and certificates; and the
malformed-file blocks in thirteen filesystem boundary tests, which keep
their directory, symlink, missing-file and child-path controls. Format
specific refusals (a truncated IPS body, a wrong shortcut CLSID, DWARF
units) keep their own tests, as do the owner tests in
parseFailureAnalysisError and ArtifactOperationFailure.

* test(errors): expect malformed target bytes as unsupported_target in acceptance tests

The first full acceptance run of this PR found five expectations still
asserting invalid_request for target-byte failures: the timing test's
truncated ELF, a truncated DTB, duplicate Rust dependency JSON, and PE32
and PE64 load-config images without an MZ header. Assert the
unsupported_target code, with format_failure malformed where the
non-MZ PE path matches the already-updated PE imports test.
2026-11-24 00:44:40 +00:00
morluto ff2f9d9880 docs(reference): say that pwntools memory failures carry no producer limit (#14221)
Both the structured resource-limit reply and the reserved memory exit omit
details.limit, because an allocation failure does not prove that
producer_limits.address_space_bytes was exhausted. The reference promised
the parameter limit for every pwntools budget failure.
2026-11-24 00:41:02 +00:00
morluto be47922331 docs: correct, re-verify and prune getting-started, provider and reference pages (#14202)
* docs: correct, re-verify and prune getting-started, provider and reference pages

Re-verify the macOS arm64 native decompiler build, the m68k lane and the
RISC-V lane on Ghidra 12.2, check RISC-V language facts against the 12.2
SLEIGH sources, document the verify:ghidra demangler prerequisite, remove
duplicated IDA and mcp add paragraphs, prune release-history narratives and
the stale 6.4.0 registry checkpoint, clarify Godot carrier classification,
correct the packet-summary and SQLite host rows, and say in the
inspect-binary-layout CLI description that it is ELF-only on Linux x64.

* docs(reference): add a canonical producer_limits section

Derive the accepted fields and defaults per operation from the producer
limit schemas and describe how an exhausted budget reports its per-call
control.

* docs(reference): split producer_limits defaults by operation and document the pwntools exceptions

Field and decoder discovery reject input_bytes, and packet field search
defaults output_bytes to 32 MiB. For pwntools, diagnostic_bytes bounds
combined stdout and stderr while output_bytes bounds the reply file, and
an oversized input reports the pwntools.max_input_bytes setting limit
rather than the producer_limits parameter shape.
2026-11-24 00:37:55 +00:00
morluto c4fa5b475c fix(cli)!: accept only the documented kebab-case option spelling (#14204)
* fix(cli)!: accept only the documented kebab-case option spelling

REA's argv parser kept incur's second spelling of every option: the
camelCase schema key (`--maxRows`) bound like the documented
`--max-rows`, although help, completion and manifests list only the
kebab-case form. That hidden alias let wrong spellings survive in the
guides.

The parser now binds only the documented flag. A schema key spelling,
including its `--no-` negation, fails as a typed `flag_spelling`
failure rendered as PARSE_ERROR that names the documented flag:
"Unknown flag: --maxRows. Did you mean --max-rows?". Completion no
longer resolves camelCase option names. The sensitive-value scan still
treats `--sensitiveValue` as a declaration so its value stays redacted
from the refusal.

Guides, the inspect-api-contract option description and tests now use
the kebab-case flags.

BREAKING CHANGE: camelCase option spellings such as `--maxRows` or
`--dryRun` are refused; use the kebab-case flag that `--help` lists.

* test(cli): exercise invalid dry-run values with the documented flag spelling

The invalid dry-run cases in strictPositionals and cliSetup appended
--dryRun=false as a later valid override. The parser now refuses that
schema key spelling before it validates the dry-run value, so each case
failed on flag spelling and never checked that a later override cannot
hide an earlier invalid value. The override is now --dry-run=false, and
each case asserts the dry-run failure message, so a spelling refusal can
no longer satisfy it.

The --dryRun=abc case in cliSetup's malformed-value list is removed: it
was the --dry-run=abc case under a spelling the parser now refuses
before reading the value, and argvParser.test.ts owns that refusal.

* test(cli): keep one public case for the flag spelling refusal

cliOptionAliases repeated argvParser's three token shapes (bare, inline
value, negation) through the full CLI. The parser test owns those shapes
and asserts the structured flag_spelling failure with its flag and
documented spelling; the CLI keeps one case for the documented
PARSE_ERROR projection, whose message is part of the CLI contract.

The camel-case sensitive-value case also dropped its trailing
--no-<literal> token: the spelling refusal stops parsing before it, so
the token no longer exercised anything.
2026-11-23 19:36:23 -05:00
morluto fc795dd260 fix(pwntools)!: report a per-call input ceiling as its producer_limits parameter (#14208)
* docs: correct, re-verify and prune getting-started, provider and reference pages

Re-verify the macOS arm64 native decompiler build, the m68k lane and the
RISC-V lane on Ghidra 12.2, check RISC-V language facts against the 12.2
SLEIGH sources, document the verify:ghidra demangler prerequisite, remove
duplicated IDA and mcp add paragraphs, prune release-history narratives and
the stale 6.4.0 registry checkpoint, clarify Godot carrier classification,
correct the packet-summary and SQLite host rows, and say in the
inspect-binary-layout CLI description that it is ELF-only on Linux x64.

* docs(reference): add a canonical producer_limits section

Derive the accepted fields and defaults per operation from the producer
limit schemas and describe how an exhausted budget reports its per-call
control.

* docs(reference): split producer_limits defaults by operation and document the pwntools exceptions

Field and decoder discovery reject input_bytes, and packet field search
defaults output_bytes to 32 MiB. For pwntools, diagnostic_bytes bounds
combined stdout and stderr while output_bytes bounds the reply file, and
an oversized input reports the pwntools.max_input_bytes setting limit
rather than the producer_limits parameter shape.

* fix(pwntools)!: report a per-call input ceiling as its producer_limits parameter

When producer_limits.input_bytes set the pwntools admission ceiling for a
call, an oversized input reported the registered pwntools.max_input_bytes
setting limit with update_mode "parameter" attached. Every other
producer budget reports the parameter shape, and AGENTS.md asks for the
limit of the control that stopped the work. Report producer_limits.input_bytes
with applies_at "next_call" and, as its default, the ceiling that applies
when the field is omitted. Setting, launch and built-in ceilings keep the
setting shape. Remove the reference exception this made obsolete.

BREAKING CHANGE: for a request-sourced pwntools input ceiling,
details.limit is now a control_kind "parameter" limit instead of a
setting limit carrying setting, source, update_mode and scope fields.
2026-11-24 00:32:01 +00:00
morluto af53dd9df1 fix(wasm): state the accepted WABT release range from its owning constant (#14205)
* fix(wasm): state the accepted WABT release range from its owning constant

`WabtRelease.ts` admits caller-supplied WABT `>=1.0.42 <1.1.0`, but the
`inspect_wasm_artifact` description, the capability inventory
remediation and the WASM static-inspection guidance said "WABT 1.0.42",
and a source comment and the WASM guide claimed managed downloads stay
pinned, although REA downloads no WABT.

The accepted range and the caller-facing release line now live in the
domain beside `WABT_VERSION`, so the contract description, inventory
remediation, error guidance and adapter messages all render the same
"WABT >=1.0.42 <1.1.0 (verified with 1.0.42)". The download claim is
removed, and the guides and skill source state the range.

* docs(wasm): state the accepted WABT release range in one owning guide section

The bundled WABT README still required an exact 1.0.42 banner while the
guide and supported-targets table stated the admitted range. Keep the range
in the WASM guide's Configure WABT section and link to it from the README
and the supported-targets table; the README keeps the verified release,
source commit and archive digest.

* test(wasm): derive WABT version assertions from the owning constants

Assert the verified release and caller-facing release line through
WABT_VERSION and WABT_RELEASE_LINE, and drop the literal range pin that the
owner-level admission boundary checks already cover.

* test(wasm): type the WABT version probe fixture by its owning type

Deriving expected_version from WABT_VERSION in an untyped literal widened
it to string; annotate the fixture as WabtVersionProbe instead.
2026-11-24 00:28:27 +00:00
morluto 8ed819573b fix(artifacts): route native images to static readers and name their architecture (#14189)
* fix(artifacts): route native images to static readers and name their architecture

inspect_artifact sent every PE, ELF and Mach-O root straight to
open_binary (PE first to inspect_managed_artifact, whatever its CLI
header) and left architecture null on every inventory node and on the
inspection subject, although the header parsers already know the CPU.

Inventory classification now returns the header's CPU family with the
format, from the same ELF, Mach-O and PE record parsers target admission
uses, so each thin image node (including universal slices and archive
members) names its architecture; an undecoded machine stays null, and a
universal container node names none. When the inventory root is the
open target's own bytes, its Evidence subject carries the architecture
target admission parsed, as it already carried the selection.

Native next probes now list the provider-free readers for the format
before open_binary: PE imports, exports, load config, resources,
hardening and release exposure; ELF dependencies, exports, hardening and
release exposure; Mach-O inspect_macho, inspect_signature, hardening and
release exposure. inspect_managed_artifact leads only when the PE
declares a CLI header, is omitted when it declares none, and stays a
conditional probe for directory members whose declaration is unknown.
The PE hypothesis that inventory cannot tell managed from native is kept
only for that unknown case.

Fixes #14157

* fix(artifacts): keep native readers for executables that carry a package

An executable whose contents inventory as an embedded package (Godot
PCK, PyInstaller, Node SEA, Deno, Bun or a .NET single-file bundle) is
also a native image. Previously inspection proposed only the package
reader and hid the native side.

The inspection now takes the native image facts that target admission
parsed for the root's own bytes, not only the PE CLI-header flag. When
inventory reads those bytes as a package, the package reader comes
first, then the carrier's static readers, then open_binary.

A probe names exactly one operation, so the static readers cannot be
grouped into one entry without changing the advertised schema. They
stay separate rows and share one short rationale, because each tool's
description already says what it reads. Each format's reader list is
now a table.

* fix(artifacts): bind a deep provider for managed PEs only at a native boundary

A PE declaring a CLI header recommended open_binary with generic
function-level advice, so pure managed assemblies were steered to a
deep native provider. Its rationale again requires managed inspection
to report a native or mixed boundary, and a PE whose header is unknown
states the same condition.

* test(artifacts): assert universal slice inventory per host and prune probe snapshots

The universal Mach-O test assumed slice inventory on every host, but the
slice reader runs native lipo and is skipped off macOS, so it failed on the
Linux test shards and portable tests. The test now selects the host platform
through a HostPlatform mock: the slice inventory case runs only on a macOS
host, and the other-host case asserts unknown container coverage with only
the file occurrence on every host. Both keep the selected-slice subject
architecture and static reader order.

Pruning in the probe tests:
- Merge the ARM64 PE, ELF and Mach-O single-image probe tests into one
  parameterised case that asserts subject and root-node architecture, the
  complete static reader list, and that open_binary is the only probe beyond
  artifact bytes.
- Remove the Deno carrier ordering case from the native image probe test;
  the Deno CLI acceptance test covers the same three carriers through the
  public workflow and now asserts the same ordering and authority facts.
- Replace full next-probe arrays in the Bun, Deno, dotnet-bundle and
  PyInstaller CLI/MCP tests with a shared carrier assertion: package readers
  lead, the carrier's format reader is present, and open_binary is last and
  the only non-artifact-bytes probe. The per-format reader list stays owned
  by the native image probe test.

Malformed-header (undecoded machine), unknown architecture and package
subject identity coverage are unchanged.
2026-11-24 00:27:11 +00:00
morluto e39b56fc5d fix(tests): narrow markdown-it attributes to strings in doc link checks (#14217)
Token.attrGet returns string | number | null, so the link checks added in
#14207 failed typecheck on main. Keep only string href values before
matching them.
2026-11-23 19:15:02 -05:00
morluto df6454c3fd fix(javascript): record the collapsed-query resource limit on observations (#14220)
#14153 added a collapsed member-mutation query that recorded its
resource limit on state.valueResourceLimits. #14148, merged after it,
moved that set under state.observations, so the line failed typecheck
and threw at runtime when a query exceeded its state budget.
2026-11-23 19:13:08 -05:00
morluto b1b0bdf011 fix(hopper): name xrefs when a selector resolves outside every procedure (#14188)
* fix(hopper): name xrefs when a selector resolves outside every procedure

The bridge collapsed every procedure-selector miss into "No procedure
exists at the requested address", even when the caller passed a name
that Hopper resolved to an import slot or data label. The TypeScript
error then attached one fixed remediation that mixed CLI and MCP
spellings and recommended list_names, which has no CLI command.

The bridge now reports how the selector resolved (symbol, address,
cursor, or unresolved name) with the resolved address. HopperRemoteError
derives its remediation and related operations from those facts: a
resolved non-procedure symbol names xrefs on its address, and the
remediation names contract operations only so each adapter renders its
own spelling through related_operations.

Fixes #14165

* test(hopper): parse selector diagnostics through the bridge wire contract

The procedure-selection regression cast the bridge diagnostic to never
and projected it directly, so the selector-resolution schema never ran.
It now frames each diagnostic as an NDJSON reply and parses it with the
Hopper reply envelope, covers a cursor outside every procedure, and
requires malformed selector resolutions to fail as protocol errors.
2026-11-23 23:27:12 +00:00
morluto cebfae50d9 perf(ghidra): retain literal search candidates only when filtering narrows them (#14143)
* perf(ghidra): retain literal search candidates only when filtering narrows them

The Ghidra bridge folds ASCII exactly, so a case-insensitive literal
search with an ASCII-foldable pattern already returns its matches.
Attaching the unnarrowed reply as rawResult repeated the full match list
in every default search_strings/search_procedures response and Evidence
record. Retain it, with the candidate limitation, only when Unicode
filtering removed a row or secondary name.

Closes #14142

* docs(ghidra): state when a literal search retains raw candidates

The native investigation guide still said every case-insensitive literal
search puts bridge candidates in raw_result. It now states the
condition. A test covers the case where filtering removes only a matched
secondary name, which keeps every procedure but must still retain the
candidates.
2026-11-23 23:24:46 +00:00
morluto 24d2c4f16b perf(javascript): share one lexical index between static and semantic analysis (#14148)
* perf(javascript): share one lexical index between static and semantic analysis

The static and semantic phases each built a private semantic state for
the same parsed program, so definitions, ambient writes and
member-mutation facts were derived twice per file.

Sharing the state requires separating what it holds. Index facts are
shared. Memoized query results are declared through one owner so a new
consumer or index step starts without them. Observations (resource
limits and returned-reference widenings) are recorded per derivation:
index steps record into the index's own log and each consumer starts
from that log, so the semantic phase reports exactly what a private
index would have.

The worker builds one index per parsed file and the semantic phase
continues from it when its resolution mode matches the static phase.

Refs #14147

* fix(javascript): let a shared lexical index continue only one semantic phase

The semantic phase appends its module links and callable facts to the
state it continues from, so a second phase from the same index reported
each import link twice. Admission is now consumed by the first phase and
a second is rejected like any other index that does not match.
2026-11-23 23:20:26 +00:00
morluto 03f68dbcba style(tests): format the SQLite acceptance test (#14209)
#14206 updated an expectation in this file without formatting it, so
format:check fails on main and on every branch built from it.
2026-11-23 18:14:22 -05:00
morluto 6adcf85fc8 test(docs): check doc facts structurally instead of pinning prose (#14207)
Derive the CI example's Node pin from .nvmrc, match the workflow link by its parsed destination instead of its link text, and replace hard-coded Persian and Malayalam headings with a check that every in-page README fragment resolves to a rendered heading or HTML anchor. Drop skill-install prose assertions already covered by byte equality with the generated skill.
2026-11-23 18:09:39 -05:00
morluto c4916a6ff7 fix(javascript): answer an over-budget member-mutation query by escaping whole objects (#14153)
* fix(javascript): answer an over-budget member-mutation query by escaping whole objects

Member-mutation analysis enumerates alias states with exact member paths
for each query. On a dense alias cluster one query can schedule tens of
thousands of states, so a handful of queries spent the whole per-source
allowance and the source was refused: a 328 KB Vite and React bundle was
refused at any allowance.

Each query now has a state budget derived from
semantic_precision.alias_selections. A query that outgrows it is answered
again as an escape of the whole value and of every value a write stored
into it. An escape covers every effect below it, so the answer is a
superset of the exact one; the alias-selections limit is recorded.
Bindings an abandoned query walked are remembered so later queries that
reach them collapse without spending their budget first.

Refs #14150

* perf(javascript): record a collapsed member-mutation query without a site

A collapsed query escaped whole objects at its own call site, so every
collapsed query walked the same dense alias cluster again. An escape that
names no site may precede any read, which readers already treat as
unknown timing. Its alias states then do not depend on the query that
reached them, and a later collapsed query stops at whatever an earlier
one covered.

Refs #14150

* fix(javascript): queue collapsed escapes instead of starting a walk per alias

A collapsed query started a nested walk for every alias reached through
a projection, so a long chain of projected aliases nested one call per
link and overflowed the call stack, where the exact walk follows the
same links through its queue. An escape walk now queues the whole-object
escape as another state.
2026-11-23 23:08:03 +00:00
morluto d506a6f6df docs: tighten contributor guidance and prune duplicated skill text (#14203)
* docs: tighten contributor guidance and prune duplicated skill and verification text

Link AGENTS.md to the CONTRIBUTING.md owners for scope, issues and pull
requests, remove change narratives from the development guides, add a
verification-record retention rule, and route format-specific skill
entries to tool descriptions and guides instead of restating them.

* chore(skill): regenerate the Cursor plugin skill copy

The skill source was trimmed in this PR; regenerate the tracked Cursor
plugin copy with scripts/generate-cursor-plugin-skill.mjs so the
documentation check's freshness test passes.
2026-11-23 18:03:55 -05:00
morluto f3ce4cabf6 docs: tighten format pages and correct stated limits (#14199)
* docs: tighten format pages and correct stated limits

Restructure the GPU code object, UnityFS, IL2CPP, model, Rust and
hardening pages for scanning, state the Rust input and report limits
as overridable defaults, replace an IL2CPP jq round trip with the
--evidence-bundle query, and remove change narratives.

* docs(model): separate the big-endian v2 and unknown-version GGUF refusals

Only unknown versions report the raw version bytes and both UINT32
interpretations with byte order unknown; big-endian v2 is recognised and
refused with its own message.
2026-11-23 18:02:09 -05:00
morluto 7b056d2ff8 fix(sqlite): state the runtime requirement in supported-runtime terms (#14206)
The capability reason, worker failure, tool description and skill
reference told users to run Node.js 24.15 or newer, below the 24.22.1
and 26.12.1 floors REA itself requires. Keep the gate on the native
DatabaseSync.limits API floor, and say instead that every supported
Node.js 24.x and 26.x runtime provides it and Node.js 22.x does not.
2026-11-23 18:01:23 -05:00
morluto 6dadd30fb6 fix(javascript): route directories by JavaScript input presence and name directory-capable operations (#14186)
* fix(javascript): refuse directories without JavaScript inputs and name directory-capable operations

`analyze <dir>` routed every non-bundle directory to the static JavaScript
lane, which reported an all-zero Electron summary as success for native
build output. The JavaScript lane now owns that applicability decision from
its complete inventory: when coverage is complete and no JavaScript, HTML,
package.json, source map, or nested ASAR input exists, it returns a typed
unsupported_target refusal naming inspect_desktop_application,
audit_release_exposure, inspect_artifact, and open_binary. Incomplete
coverage or unavailable files of unknown kind stay unknown and proceed.

The directory_requires_file refusal no longer claims to come from
open_binary when another operation (inspect, inspect-artifact) admitted the
target, and it names the directory-capable operations instead of only the
JavaScript lane.

* fix(javascript): keep empty directories analyzable and report routing facts for non-JavaScript ones

Owner decision on #14186: an empty directory is "nothing to analyze", not
"unsupported". The JavaScript lane now classifies application-input
presence once, in the domain owner of its file facts
(javaScriptApplicationInputPresence): present, empty, absent, or unknown.

- empty (complete traversal, no non-directory entries): analysis succeeds
  as before and the graph carries an explicit "No JavaScript inputs were
  found" limitation naming the next operations.
- absent (complete traversal, entries but no JavaScript, HTML,
  package.json, source map, or nested ASAR): the typed unsupported_target
  refusal now carries bounded diagnostics from the inventory the lane
  already read: inventoried_entries, entries_by_format, json_files and
  native_addon_files. No paths are retained.
- unknown (incomplete traversal or unavailable file of unknown kind) and
  present: unchanged analysis.

Reverts the fixture edits that added package.json to empty directories.
2026-11-23 18:00:43 -05:00
morluto a1d53d3956 docs(development): route first contact by parsed facts and split admission limits from delivery budgets (#14193)
* docs(development): route first contact by parsed facts and split admission limits from delivery budgets

Add first-contact routing rules, provider-neutral selector semantics,
address-space naming, once-per-session caveats, sibling-reader parser
sharing and target-versus-request error categorization to the tool
design guide. Replace the unpaged-by-default rule with bounded summaries
backed by retained Evidence, and distinguish refusing admission limits
from non-refusing delivery budgets. Add public-corpus checks to the
testing guide and tighten the audit and workflow sections.

* docs(development): bind mutable-state cursors to a revision and limit retryable to idempotent retries

* docs(development): share parsing, not admission policy, across sibling readers

Sibling readers of one format need different amounts of the same header,
so they share the parser and structural checks while each operation keeps
its own required fields and admission policy. Align the AGENTS.md limits
rule with the admission-limit and delivery-budget split.
2026-11-23 23:00:10 +00:00
morluto 75c733acb4 fix(examples): pin the CI example to the current REA release (#14201)
The GitHub Actions example pinned rea-agents 6.7.0 and its test
hard-coded the same string, so the pin went stale silently across
three releases. Pin 6.10.1 and derive the test's expected version from
package.json, so a release bump fails the test until the example is
updated. Stop naming a fixed version in the CI analysis guide.
2026-11-23 17:58:02 -05:00
morluto 609b58b109 perf(debugger): stop repeating command results as raw_result (#14146)
* perf(debugger): stop repeating command results as raw_result

GDB console/startup, Rizin debug, Cutter and reverse-engineering command
Evidence set rawResult to a copy of result, contrary to the raw_result
contract. Every interactive debugger reply therefore carried its records
and output twice. Omit rawResult where no distinct provider
representation exists; tests assert the same facts on normalized_result.

Closes #14145

* test(debugger): assert command results on normalized_result in remaining suites

The composition, CLI delivery, acceptance and MCP suites still read
command output through raw_result, and one fixture built a parent
Evidence record that repeated its result as raw_result. They now assert
the same fields on normalized_result and that raw_result is null.
2026-11-23 17:55:57 -05:00
morluto 4b5fcc9eab docs(guides): correct host requirements and prune change notes in runtime, web, data guides (#14197)
docs(guides): correct host and runtime claims and prune change notes

Correct sigrok, firmware and SQLite host/runtime requirements and a v8 CLI
flag, remove consumer-migration and historical asides, and drop duplicated
sentences in the JavaScript, web, runtime, data, firmware and signals guides.
2026-11-23 17:55:40 -05:00
morluto 77b5b76e99 docs(guides): correct native and platform guide flags, host limits and stale notes (#14198) 2026-11-23 17:51:36 -05:00
morluto bdefa90dfb docs(verification): remove dated records that nothing cites (#14196)
Delete 54 dated verification records and companion JSON files that no
document, script, test or sidebar entry references. Keep the records
that live docs cite as evidence, the script-produced release-exposure
record, and the JSON companions those records link to. Move the one
record a test reads as data into tests/fixtures/javascript beside its
consumer. Git history retains every removed record.

Claude-Session: https://claude.ai/code/session_01TBh3FSTJTdVSc2DntiwVY7
2026-11-23 17:44:41 -05:00
morluto d6321bb3d0 chore: ignore the .claude agent directory like other local agent tooling (#14194)
Agent worktrees under .claude/worktrees carry their own .oxlintrc.json.
oxlint discovers it as a nested configuration and rejects it, so lint,
check:fast and the pre-push hook fail for the whole checkout. .codex,
.devin and .factory are already ignored for git and lint; .claude was
not.
2026-11-23 17:44:10 -05:00
morluto 8f4f397341 perf(javascript): merge data-effect traversals and look up callable kinds (#14149)
Configuration, request and boundary candidates were each collected by a
whole-program traversal that rebuilt the same callable and ancestor
stacks, followed by two more for defaults and response consumers. The
three independent collectors now share one traversal and the two that
read their results share another.

Callable ownership is asked of every node on entry and exit in about a
dozen passes. It is now one lookup by node type, derived from Babel's
Function and Class aliases, instead of a chain of type guards.

Refs #14147
2026-11-23 17:31:34 -05:00
morluto 998512eeb8 fix(javascript): report no loader call in a program that names no CommonJS loader (#14191)
Two loader queries answer "unknown" when they exhaust their alias
budget, and callers report that as a require reference. Ordinary calls
such as node.getClientRects() were reported as dynamic requires in
programs that contain no loader at all, and on dense bundles those walks
dominated the static phase.

Every loader identity these queries recognize is rooted in a name the
program must contain (require, module, a mainModule member, the module
builtin, process used as a value, or global code) or in a bundler
factory binding. One pass over the syntax establishes whether a program
names any of them. When it names none, both queries answer without
walking.

Closes #14190
2026-11-23 17:27:29 -05:00
Truong Giang bf913bc3dc docs(i18n): standardize Vietnamese translations for guides and common terms (#14141)
* docs(i18n): standardize Vietnamese translations for guides and common terms

* docs(i18n): address review feedback on verification claims and analysis guidance
2026-11-23 20:18:03 +00:00
morluto 3a63f7803f test(ida): decode the Hex-Rays query line without importing site (#14144)
The decoder asserts empty stderr, but -I still imports site, so a host
sitecustomize that writes to stderr failed the test. The decoder needs
only ast, json and sys; -S removes the dependency on host site setup.
2026-11-23 19:59:06 +00:00
Anurag SinghandAnurag Singh 604e087c31 fix(adb): report macOS ownership preparation failures as typed host prerequisites (#14140)
Since adb runs under owned supervision, a failed macOS ownership helper
build reached the adb version probe as an unreadable result, so one broken
toolchain failed all of binary_session. adb now reports the shared
ownership_preparation failure that apktool, JADX and Ghidra report, and its
availability probe turns it into runtime_unavailable.

When the host refuses the helper's compiler for capacity (EMFILE), that
retryable constraint now stays primary over the helper root it could not
remove, which remains a retained cleanup dependency.

The four providers build the preparation error through one owner,
ownershipPreparationError, next to the availability check that reads it.

Fixes #13943

Co-authored-by: Anurag Singh <211784907+Anurag-5ingh@users.noreply.github.com>
2026-11-23 19:35:58 +00:00
gensokyo-devandgensokyo-dev 3cfbe81509 test(analysis-view): cover compressed-size inventory ordering
The ordering test selected only declared_size, so an implementation that
ignored order_by.field still passed. Add an archive whose repetitive text
is declared larger but compresses smaller than incompressible bytes, and
assert both orders with the directory's unknown size last.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-24 02:54:49 +08:00
gensokyo-devandgensokyo-dev 17877d9df5 fix(analysis-view): match inventory path globs without backtracking
Globs compiled to regular expressions in which every * became another
overlapping [^/]* group, so a selector such as *a*a*a*a*a*a*a*a*b took
polynomial time in the name length to reject a long run of a's, and
selection runs synchronously before paging. Match each segment with the
two-pointer wildcard algorithm, which keeps one retry point and bounds
work to pattern length times segment length, and resolve ** segments with
a reachability pass over path segments. Matching semantics, including
code-point ?, literal metacharacters and a trailing ** needing one segment,
are unchanged.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-24 02:54:49 +08:00
gensokyo-devandgensokyo-dev 386d294f90 feat(analysis-view): order inventory occurrences by size before paging
Finding the largest files in an archive meant reading every occurrence
and sorting client-side, which for a jar of 28,671 entries is tens of
megabytes of rows. Add order_by with field declared_size or
compressed_size and an ascending or descending direction. Selected rows
are ordered before paging; unknown sizes, such as directories, come last in
either direction and ties keep inventory order. The container's own "."
row carries its size, so the description points at path_globs ["**"] to
rank only its entries.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-24 02:54:49 +08:00
gensokyo-devandgensokyo-dev dba72f1277 feat(analysis-view): select inventory occurrences by path glob
Questions about one directory of a large archive, such as the native
libraries under lib/ in an APK or the classes of one package in a jar,
required paging every occurrence, because occurrences could be selected
only by exact path, ID or kind. Add path_globs, which match whole recorded
logical paths: * and ? stay within one segment, a ** segment spans zero or
more segments (or everything below when last), other characters are
literal and case-sensitive, and the container's own "." row never matches.
Several globs union, then intersect with the other selectors, so one call
returns, for example, every file at the archive root or below assets/.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-24 02:54:49 +08:00
54d62c75da perf(mcp): serve compact output schemas from the build-recorded catalog (#14121)
* perf(mcp): serve compact output schemas from the build-recorded catalog

The compact output profile forced the eager runtime: full server composition plus runtime schema compaction measured at ~700 ms init + ~421 ms first tools/list, vs ~125 ms deferred for the default profile. The catalog recorder now also records bounded compact output advertisements per tool at build time; the deferred server serves them verbatim (new recorded presentation kind, canonical validation unchanged on calls), main admits the compact profile to the deferred path, and catalogs recorded before this field fall back to eager. Measured after: compact init 118 ms + list 7 ms at the same ~672 KB payload.

Refs #13275. Verified: DeferredEvidenceMcpServer tests (17), check:fast, build:cached, and a stdio probe comparing default/compact/hot-cold initialize and tools/list timings and bytes.

* fix(mcp): align compact deferred listings with the recorded catalog

Deferred compact startup used the off-profile catalog digests, so the first
tool call rejected the runtime. Select the digest for the configured output
profile.

Recorded output presentation skipped compaction for every listed schema.
Track which tools have a build-recorded advertisement and compact live
registrations, including discover_tools.

The recorder stored a contract projection. Legacy clients receive that
projection after the SDK stamps or wraps a non-object root and REA compacts
the listing. Record that listed schema.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* docs(mcp): describe recorded compact startup

Compact stdio startup serves the recorded catalog, including compact output
when that catalog has compact schemas. A compact profile whose catalog has
none falls back to eager composition. Initial-target, HTTP, family-scoped
hot/cold, and source runs without recorded artifacts stay eager.

Co-authored-by: morluto <morluto@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-23 13:40:29 -05:00
dcf7e25d09 perf(process): pool regex workers across match calls (#14114)
* perf(process): pool regex workers across match calls

matchRegexValues spawned a fresh worker_threads Worker per call (~10.5 ms measured, vs ~0.9 ms pooled for a trivial match on 1-5k candidates). Workers are now pooled by heap class (max 4, 10 s idle reap, unref'd while idle): the worker protocol is message-driven, a worker is reused only after a clean matched/invalid-pattern reply, and deadline, abort, error, exit or malformed replies retire it so a stuck pattern can never poison the pool. Queueing for a busy pool counts toward the caller's deadline. Results, heap and deadline errors, and cancellation semantics are unchanged.

Closes #14110. Verified: RegexMatcher + RegexMatcherReply + boundary regexMatcher + HopperRegexSearch + IdaOperationRunner tests (91+15), check:fast, and a 15-call benchmark (10.5 ms -> 0.9 ms per call).

* test(process): use the admitted deadline source spelling in the pool test

* fix(process): enforce queue deadlines, reclaim idle regex workers, and await retirement

Address pooled-worker review findings: the matching deadline now starts before pool acquisition (queue waiters expire and expired jobs are never posted), idle workers of another heap class are reclaimed instead of blocking a changed heap setting, queued worker startup failures reject into the normal Cannot-start path, and non-clean outcomes await worker termination before returning so close() cannot finish while matching work lives. Add RegexMatcherPool.test.ts with a construction-counting fake worker proving reuse across clean calls and termination-before-return plus replacement after a deadline.

* fix(process): allocate regex workers through one capacity path

Acquisition retired an idle worker and spawned directly, bypassing waiter order: retirement served an older waiter into the freed slot and acquisition then spawned a fifth worker. Acquisition now only takes an idle match or enqueues, and serveRegexWaiters owns every spawn/reclaim decision in waiter order. Add a mock-pool regression proving a fifth queued search deadlines at four constructions.

* fix(process): reclaim incompatible regex workers on one path

Keep a stopping worker counted until terminate settles, and let release
ask the shared allocator so a different heap does not wait out the idle
reap. A failed stop stays owned and is recorded beside the match error.

* fix(process): mark background regex-worker stops and release test gates

Typed lint rejects an unmarked beginStopRegexWorker promise, so the
allocator's fire-and-forget stops are explicit. Pool tests release held
workers in finally, including when an assertion fails first.

Co-authored-by: morluto <morluto@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-23 18:19:56 +00:00
吴佳浩Albenand吴佳浩 4d7594f672 fix(gpu): name an unreadable shared section instead of a bare null count (#14133)
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
2026-11-23 18:13:38 +00:00
morlutoandCursor Agent 6ff972da99 perf(browser): fetch source maps with bounded lookahead and in-order admission (#14115)
* perf(browser): fetch source maps with bounded lookahead and in-order admission

fetchWebSourceMaps awaited each map's full fetch-decode cycle before starting the next, so bundles with dozens of external maps paid serial round trips. Responses now start with a lookahead of 4 (approved origins only, never past the operation deadline), while every budget (URL bytes, retained bytes, decoded records), deadline check and decode still happens strictly in request order inside fetchOne, so item order, inclusion under output limits and limitations are unchanged. A started prefetch that is never admitted is cancelled in teardown, and abort/deadline paths route through fetchOne so retained-cleanup ownership (SourceMapPendingFetch) is preserved.

Closes #14109. Verified: WebSourceMapFetcher tests 31 passed (30 existing unchanged plus a new out-of-order-completion proof asserting overlap >1 and request-order admission), check:fast.

* fix(browser): abort and bind cleanup for unadmitted source-map prefetches

Teardown now aborts the operation controller before removing deadline/caller controls, and every started-but-unadmitted prefetch is settled and bound to the returned result: pending-fetch cleanup becomes the retained failure (or a secondary failure on an existing error), and unread prefetched responses are cancelled with cleanup failures tracked. The lookahead test now gates six requests to prove the four-fetch cap.

* fix(browser): pipeline source-map fetches without speculative or reordered requests

Start each request's fetch after its budget reservation and deadline checks pass, and start the next fetch only when the current body is read and the next failure reservation still fits. Redirect chains and host-observable request order stay sequential; the next fetch overlaps only the current decode. Sibling binding now ignores teardown-abort artifacts and binds only genuinely incomplete cleanup. Boundary suites (49 tests) and unit suite (31) pass unchanged in their budget and redirect assertions.

* fix(browser): retain sibling source-map cleanup on teardown

Cancellation that stops admission at the first map left later lookahead
fetches owning unread responses. Teardown skipped stored failures and
recorded the rest only as secondary notes, so the returned error could
report cleanup complete while those resources were still owned.

Await every started prefetch and merge its live cleanup through the
existing cleanup-composition helpers, preserving remaining resources.

* fix(browser): keep caller cancellation through source-map cleanup

Unused-prefetch teardown chose success before its cleanup wait and after
the caller abort listener was removed. Recheck the caller signal after
that wait so a cancel during a successful release stays a cancellation,
while an existing failure keeps its cleanup owners.

Cover unused-prefetch release, mixed redirect and prefetch cleanup, and
cancellation during release with structured cleanup facts.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-23 18:06:51 +00:00
morlutoandCursor Agent eccd18a2cc feat(javascript): add semantic_analysis structure-only mode to analyze_javascript_application (#14117)
* feat(javascript): add semantic_analysis structure-only mode to analyze_javascript_application

On large Electron apps the default analysis runs full semantic analysis per file (364 s measured in #14100) although first questions are application-graph facts. semantic_analysis: structure-only returns static and application-graph facts without semantic IR, graph content or traces: the worker purpose protocol gains structure-only (full static checkpoint, semantic phase skipped, no semantic result budget consumed), adoption records the mode once as a limitation, and Evidence parameters record the selection. Default complete behavior is unchanged.

Closes #14116. Verified: javascriptArtifactReconstruction, electronApplicationAnalysis and javascriptApplicationService suites (75 tests incl. new structure-only e2e), worker server/schema tests, check:fast, docs:check, advertised schema summary regenerated.

* test(javascript): assert semantic relations in the structure-only test

* fix(javascript): record structure-only semantic coverage as incomplete and retain refusal facts

Structure-only files now record a semantic unavailable reason so graph coverage cannot claim complete examination (comparisons will not report skipped bindings as removed), member-mutation refusal checkpoints cross for structure-only as they do for complete analysis, and the e2e control asserts real semantic content under the default.

* docs(javascript): document semantic_analysis and expose --semantic-analysis

The owning reconstruction guide now describes the complete default, what structure-only returns and skips, and how to follow up with complete analysis of selected sources. The CLI projection declares the field so --semantic-analysis <complete|structure-only> is accepted with the contract enum.

* fix(javascript): record structure-only application coverage as partial

Structure-only omits source-module and export-binding nodes. The
application graph now reports partial coverage with a null omission
count, so a comparison of an unchanged application treats those
bindings as unknown rather than removed.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-23 17:56:32 +00:00
fba6b6f9ae chore(deps): update MCP TypeScript SDK to 2.4.0 (#14129)
* chore(deps): update MCP TypeScript SDK to 2.4.0

Bump @modelcontextprotocol/server and @modelcontextprotocol/client (and core transitively) from 2.3.1 to 2.4.0, the current v2 release; the legacy @modelcontextprotocol/sdk package line (1.x) is not used. Regenerate package metadata. Notable upstream changes checked against REA usage: no x-mcp-header annotations are used, output schema ids are urn: URIs accepted by the new Ajv fast-uri, and REA does not unwrap structuredContent.result. The 2025-11-25 structuredContent wrapping change for meta-id output schemas is client-visible and noted for release notes.

Verified: check:fast, DeferredEvidenceMcpServer + toolOutputReferences suites (53 tests), deferredRuntime + serverLifecycleMcp boundary suites (41 tests), and a stdio initialize/tools/list probe on all profiles after a clean build.

* fix(contracts): keep compact output unions when the SDK stamps an object root

MCP SDK 2.4.0 treats a $ref union of objects as an object and stamps
type:object before tools/list. Compact reduction then dropped that union
and advertised an empty property bag. Reduce each alternative's root
shape instead, and advertise widened oneOf branches as anyOf so
overlapping branches still accept canonical results. guided_workflows
already declared that object root and had the same empty advertisement.

Refresh the advertised catalog summaries for guided_workflows,
read_guidance_section, and search_guidance.

* chore(licenses): refresh the MCP SDK 2.4.0 dependency inventory

Regenerate licenses/npm-dependencies.txt with the license inventory
script. Update the three runtime notice identities from the lockfile
after checking each 2.4.0 archive integrity and LICENSE text; those
license bodies are unchanged. The notice fingerprint matches the
generator.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-23 12:47:37 -05:00
a92d502472 docs(github): require reported verification and factual docs in PR template (#14130)
* docs(github): require reported verification and factual docs in PR template

Record the maintainer checks for running needed validation, limiting
comments to constraints and decisions, and keeping documentation factual.
Mirror that guidance in AGENTS.md where it was not already stated.

* docs(github): assign the PR checklist to the author

Rename Before merge so the PR author completes it before requesting
review, and point the draft-PR note at that section.

* docs(github): confirm root cause and engineering rules on PRs

Add a few author-checklist items for the root cause, owning-boundary
interpretation, retained cleanup facts, and REA_ limit settings.

* docs(github): attest engineering rules in the PR template only

Restore AGENTS.md to main and phrase the new author-checklist items
as author attestations, including hardcoded limits rather than every limit.

Co-authored-by: morluto <morluto@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-23 12:43:44 -05:00
morlutoandCursor Agent d72dc9d979 perf(contracts): prune only over-depth schema branches instead of reducing whole schemas (#14107)
* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas

A schema whose inlined form exceeded the depth-10 advertised limit fell back to reduceToShallowProperties for the entire tool, erasing enums and nested validation on all root properties. pruneSchemaBeyondDepth now replaces only sub-schemas past the prune depth with type-preserving placeholders (every replacement widens acceptance, so canonical server-side validation is unchanged), and both input and output compaction keep the pruned form as inline when it fits bytes, depth and dialect checks. Two compactInputSchema tests that pinned depth-forces-reduction now pin the pruned-inline contract with the same Ajv/dialect safety assertions.

Refs #13302. Verified: compactInputSchema, compactOutputSchema, toolSchemaMetadata, advertisedInputExamples (59 tests), check:fast, docs:check.

* docs(contracts): refresh advertised schema summary for pruned-inline compaction

Pruned-inline schemas retain patterns (digest, Evidence id and text patterns) that whole-schema reduction dropped on 13 tools; regenerate the committed catalog summary with npm run verify:advertised-schemas -- --update-summary and re-verify clean.

* fix(contracts): make deep-schema pruning widening-safe

Walk schema positions instead of raw JSON, preserve declared integer types, keep branches that fit, return no pruned schema under not/oneOf where widening can reject valid values, and recheck output byte budgets. Add regression coverage for closed objects, unsafe combinators, fitting enums, and nullable integers; refresh advertised summaries.

* fix(contracts): keep untyped deep schemas unconstrained when pruned

Inferring object from properties or array from items narrows an untyped schema, which accepts every JSON value; the placeholder is now always unconstrained when no type is declared. Add an Ajv regression accepting null and nested values through a pruned untyped branch.

* test(contracts): assert pruned untyped schemas at depth 8

The regression accepted values that never reached the replaced node, so
it stayed green for an object placeholder and did not distinguish
branch pruning from whole-schema reduction. Assert the empty schema at
depth 8 and accept null there.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-23 12:42:55 -05:00
morluto e60777b76f perf(tests): supervise direct vitest scripts through run-exclusive on POSIX (#14104)
* perf(tests): supervise direct vitest scripts through run-exclusive on POSIX

test:run, test:with-build, test:boundary, test:mcp, test:acceptance, test:integration, test:coverage and test:verbose invoked vitest directly, so an interrupted run could orphan detached provider children outside the owned process group. They now go through scripts/run-vitest.mjs, which wraps Vitest in run-exclusive --unlocked on non-Windows platforms (mirroring run-development-tests.mjs) and invokes Vitest directly on Windows, where source tests must not require the built Job Object artifact. Watch and CI shard scripts are unchanged.

Refs #13357. Verified: launcher smoke run (4 tests passed), check:fast, knip.

* fix(tests): forward stop signals from the vitest launcher to its child

The launcher ignored SIGINT/SIGTERM when wrapped, so a signal sent only to its PID left Vitest and its descendants running. It now always forwards to the child (run-exclusive can only forward signals it receives itself) and reports the tracked signal's exit code (143/130) deterministically. Verified with a manual probe: SIGTERM to the launcher PID during a 60s fixture test exits 143 with the tree stopped; launcher smoke run passes. A nested-supervisor in-process test proved environmentally unstable (the inner Vitest main is killed under nested run-exclusive supervisors) and was not landed.
2026-11-23 12:06:28 -05:00
morluto 26d0bc7737 refactor(application): move AnalysisViewRetention to a light module and defer view loading in services (#14102)
* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services

AnalysisViewRetention and requireAnalysisViewRetention moved from AnalysisViewService (which pulls the 1.3 MB analysis-view result graph) into AnalysisViewRetention.ts, which depends only on error and Evidence port types. All type-only consumers now import the light module. ApkSignature, Il2cpp and Reverse services load AnalysisViewService dynamically only on the detail=summary branch, and executeArtifactInspection checks retention readiness through the light module and loads the view service only after a successful inspection. No behavior or wire change.

Refs #13275, #13940. Verified: check:fast (typecheck, lint, architecture guards), 93 source tests (AnalysisViewService, Il2cpp, ApkSignature, Reverse), cliStartupImports 10/10 on pinned Node 24.22.1, knip clean. Remaining static importers (ArtifactComparisonEvidence, environment build/state, Frida sync inspectStatus, server bindings) still block a full chunk split and stay in #13275.

* fix(application): recheck cancellation after lazy view imports and guard static view links

An abort arriving while the dynamic AnalysisViewService import was pending still recorded and returned a successful summary. ArtifactInspectionExecution, ApkSignature, Il2cpp and Reverse now recheck the signal after the import (retaining the complete Evidence as the cancelled partial observation) before projecting. Add a counted architecture guard so static AnalysisViewService imports in application services cannot return silently; the baseline records only the known synchronous helpers and Frida path tracked in #14112.
2026-11-23 12:00:29 -05:00
morluto 90c374ea9c perf(search): derive literal candidates from regex alternations (#14106)
* perf(search): derive literal candidates from regex alternations

extractRequiredRegexLiteral previously returned undefined for every alternation, so regex search_strings/search_procedures with alternatives paged full IDA inventories and transferred full Hopper inventories for Node-side matching. It now computes, for top-level and required-group alternations, the longest literal every branch guarantees (longest common substring of each branch's required runs) and returns it as the provider candidate; Node still verifies the full ECMAScript regex on candidates, so the candidate remains a zero-false-negative prefilter. A branch-common segment floats inside each branch and is never joined to neighbouring literals.

Refs #13353. Verified: regexLiteralCandidate tests (including the /u and /iu zero-false-negative corpus with new alternation patterns), IdaOperationRunner tests, HopperRegexSearch tests, check:fast with architecture guards.

* fix(search): require two code points for alternation candidates

A single shared code point (e.g. matched|absent -> a) matches nearly every value, so alternation-derived candidates now require at least two code points to be worth a provider round trip; shorter commons fall back to full inventory as before. Single-branch literals keep existing behavior. HopperRegexSearch routing tests pass unchanged.

* fix(search): bound alternation candidate extraction work and nesting

Long disjoint alternatives could spend hundreds of thousands of substring probes on the calling thread, and nested alternation groups recursed once per nesting level. Cap total probes (falling back to the full inventory past the budget) and cap alternation recursion depth, abandoning only the over-deep branch. Tests cover 2000-deep nesting and 1024-char disjoint alternatives.
2026-11-23 11:55:24 -05:00
morluto d7ba8adbc3 fix(ida): extend verifier admission check deadline to 90s
The admission check spawns scripts/verify-real-ida.mjs, which imports the
full dist graph before reaching the early admission errors. Under CI shard
load that exceeded the 10s command deadline and failed Test shard (5/12)
on main, while the same sha passed the scheduled run. The sibling verifier
observations check already uses 90s for the same script.
2026-11-23 11:52:21 -05:00
morluto fae1cc260d refactor(frida): make inspectStatus async and load the view service lazily (#14108)
FridaInstrumentationService was the last application service statically importing AnalysisViewService for a conditional summary branch, because inspectStatus was synchronous. It is now async (its only production caller, debuggerToolBindings, already runs it inside an async handler), loads AnalysisViewService dynamically only when detail=summary, and otherwise imports only the retention check. Tests updated to await the six call sites; no behavior change.

Refs #13275. Verified: FridaInstrumentationService tests (37), check:fast. Stacks cleanly with #14102, which moves the retention import to AnalysisViewRetention.ts; resolve by taking that import line if both land.
2026-11-23 11:27:44 -05:00