Commit Graph
5875 Commits
Author SHA1 Message Date
morluto 351c2f4a03 fix(ghidra): carry only the latest launcher output in error diagnostics (#10555)
* fix(ghidra): carry only the latest launcher output in error diagnostics

Ghidra retains up to 8 MiB of launcher output so it can scan for failures,
and every error projected all of it into details.diagnostics. A startup
timeout on a large binary produced an 11 MB error payload (#10365).

Project the last 64 KiB of each retained stream, the bound gdb, rizin and
native commands already use, and record text_bytes next to the existing
observed and retained byte counts. Redaction runs on the whole retained text
before the cut. Add utf8TailExcerpt as the shared helper that keeps the end
without splitting a character.

Refs #10365

* fix(ghidra): preserve actionable launcher diagnostics

* test(ghidra): keep launcher scenarios independently scoped

* refactor(ghidra): parse launcher failures once in the diagnostics owner

ghidraFailureOutput parses every retained line with the single launcher-failure parser and carries bounded, redacted facts with their source line. The error projection reads those facts instead of re-scanning stream text, and the superseded line filter and ghidraJavaHomeSaveDenial text scanner are removed.
2026-11-14 19:01:26 -05:00
morluto 6c062c9c2a fix(setup): stop writing the default compact input profile for Kimi and LM Studio (#10559)
* fix(setup): stop writing the default compact input profile for Kimi and LM Studio

The server already advertises compact input schemas when
REA_MCP_INPUT_SCHEMA_PROFILE is unset, so setup no longer adds that value to
Kimi Code and LM Studio registrations, and doctor/status no longer report a
registration without it as stale. Explicit stored or setup-environment
profiles are still preserved.

Refs #10514

* fix(setup): validate LM Studio registration environment

* test(hopper): retry cleanup after confirmed application exit
2026-11-14 19:01:15 -05:00
morluto a0d96e520e refactor(artifacts): classify container formats through one recognizer table (#10629)
Inventory classification and binary target resolution each kept their
own ordered chain of container sniffers (iNES, ZIP, Godot PCK, UnityFS,
wxapkg, uImage, HEX/S-record, UF2, DfuSe, ESP flash and image, FIT,
NTFS MFT, binary plist). Both now walk ARTIFACT_FORMAT_RECOGNIZERS in
src/domain/artifactFormatRecognition.ts.

A recognizer reports recognized, refused (the header names a format
this file cannot be read as) or needs-input (the DFU trailer or an ESP
flash layout). Each route keeps only its policy: resolution reads the
trailer or locates the flash layout on demand and refuses with
file_format_rejected; inventory falls through on a refusal or a missing
input, as before.
2026-11-14 19:01:03 -05:00
morluto fd555be8b4 refactor(errors): type 14 baselined resource refusals as fixed ceilings or measured exhaustion (#10639)
* refactor(errors): type 14 baselined resource refusals as fixed ceilings or measured exhaustion

Fixed ceilings (NTFS journal file, web-bundle worker transfer, Playwright trace parser, lipo field retention, exactly representable file sizes) now name their allowance; observed heap or result-capacity exhaustion and occupied admission declare measuredExhaustion. The typed-resource-refusal baseline drops from 24 sites in 19 files to 10 in 10.

* fix(browser): name the trace parser allowance the record actually exhausted

* test(ntfs): compare the oversized-acquisition recovery with its owning formatter
2026-11-14 19:00:38 -05:00
morluto d8c3be9ba5 fix(ghidra): deliver the bridge's invalid_request rejection to the caller (#10659)
The Java bridge answered an unparseable request with a fixed id 1 and
closed the connection. The client ignored that reply because id 1 was
already settled, so the caller saw a socket-close process failure instead
of invalid_request. The bridge now reserves id 0 for connection-level
failures, and the client fails the request in flight with the remote
reason (or reports a protocol failure when nothing is in flight).
2026-11-14 18:59:58 -05:00
morluto f88d8964f9 fix(hopper): validate every bridge reply against one contract table (#10662)
* fix(hopper): validate inventory replies against their contracts at the provider edge

Hopper validated only the response envelope. list_names replies outside
the inventory contract were returned unchanged (projectHopperNameInventory
passed them through), and the regex search re-parsed its inventory with
its own policy. A per-method reply contract table built from the shared
native inventory schemas now validates list_names, list_procedures,
list_strings, search_procedures and search_strings once; a reply outside
the contract is an AnalysisOutputError. The remaining 31 operations are a
counted pending list that may only shrink.

* fix(hopper): add reply contracts for scalar, boolean and address-list operations

Twenty-two more Hopper operations are validated against reply contracts
built from the shared native schemas. The pending list shrinks from 31
to 9 operations.

* refactor(hopper): validate every bridge reply through one contract table

The reply table now covers every bridge method REA reads, including the
private caller-reconciliation methods. HopperFileOffset receives a
validated observation and HopperCallerReconciliation reads typed replies
instead of keeping its own schemas and re-parsing the native result. The
segment list schema moves from contracts into its domain owner.

* fix(hopper): apply reply contracts on the ready path and test every entry path

executeIfReady validated only list_procedures, so a malformed
list_documents reply could reach the completion path. Every contracted
operation is now validated there, and provider-level tests cover the
direct and ready paths for each inventory and document operation.
2026-11-14 18:59:39 -05:00
morluto a22fb6e60b fix(model): report malformed GGUF and Safetensors headers as invalid_format through ParseFailure (#10667)
* refactor(model): report GGUF and Safetensors format failures through ParseFailure

* fix(model): report malformed model headers as invalid_format through the shared mapping

Malformed and truncated GGUF and Safetensors headers now take the shared ParseFailure mapping (invalid_request, invalid_format on path) instead of the model provider's own BinaryTargetError file_format_rejected. Unsupported forms stay unsupported_target and model allowances keep their resource-constraint recovery.
2026-11-14 18:58:59 -05:00
morluto 2705aad365 fix(il2cpp): select universal binary slices through the shared Mach-O selection (#10661)
* fix(il2cpp): select universal binary slices through the shared Mach-O selection

* test(il2cpp): assert selection facts instead of full sentences
2026-11-14 18:58:48 -05:00
morluto ef15353c69 refactor(android): build mobile-provider cancellations with a required reason (#10590)
* refactor(errors): require a reason for every analysis cancellation

Add cancelledBy, the one constructor for AnalysisCancelledError. Its
reason argument is required: an aborted signal, an earlier cancellation,
a reason carried from an inner failure, or an OwnerCancellation when REA
closed the work's owner itself.

Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and
binary-session record owners now report OwnerCancellation.ownerClosed
instead of an absent reason. Firmware's predecessor wait returns its
cancellation as a Result, removing an unreachable reason-less fallback.

An architecture guard rejects new direct constructions, with a counted
per-file baseline that can only shrink.

* refactor(errors): share one aborted-signal predicate with cancelledBy

* refactor(process): return a departing caller's reason from a shared startup wait

* refactor(android): build mobile-provider cancellations with a required reason

Migrate every remaining AnalysisCancelledError construction under
src/adb, src/android, src/apktool, src/apkSignature, src/flutter,
src/il2cpp, src/dotnet and src/frida to cancelledBy and lower the guard
baseline from 671 to 608. A closed adb provider reports
OwnerCancellation.ownerClosed for later probes, and JADX and apktool
shutdown abort with that typed reason.

* refactor(providers): build decompiler-provider cancellations with a required reason (#10587)

Migrate every AnalysisCancelledError construction under src/ghidra,
src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the
guard baseline from 671 to 572. Closed Kuna target commands report
OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and
JEB close abort their lifetimes with that typed reason.

* fix(errors): read the reason of any signal-shaped cancellation source

* test(ci): cover the counted-baseline comparison behind the architecture guard
2026-11-14 18:58:38 -05:00
morluto b342254f9a refactor(macho): read universal Mach-O slices only where admission selected them (#10642)
Hopper and native dispatch metadata re-ranked FAT slices from the target's
architecture name instead of reading the admitted universalSlice. Both now
consume the admitted range and refuse when it is missing or undeclared.
Mach-O load-command codes move to one table with an architecture guard.
2026-11-14 18:57:55 -05:00
morluto 3080a63729 fix(gpu): report malformed GPU containers as invalid_format (#10644)
fix(gpu): report malformed GPU containers as invalid_format through the shared parse-failure mapping

GpuCodeObjectsProvider mapped a malformed BinaryFormatFailure to a
BinaryTargetError (target_unavailable / file_format_rejected) while every
other format parser reports malformed bytes as an invalid path
(invalid_request / invalid_format). It now uses parseFailureAnalysisError.
2026-11-14 18:57:45 -05:00
morluto 3e9400873e refactor(browser): register target, storage and acknowledgement CDP replies (#10630)
* fix(browser): type CDP command replies and parse frame trees once

CdpConnection.send is typed by method name. A command registered in
src/browser/protocol/CdpCommands.ts has its parameters typed from the
protocol table Playwright ships and its reply parsed once by its own result
schema; a mismatch rejects that command with CdpMalformedReply
(protocol_error, command, JSON pointer) without poisoning the connection.
Playwright storage sessions admit replies through the same table.

Page.getFrameTree and Page.getResourceTree are the first registered
commands. Their one parser keeps per-frame facts tolerant (malformed child
entries remain explicit omissions) and replaces the per-site readers:
observeMainFrameUrl, mainFrameUrl, walkFrameTrees, frameTreeResources,
runtimeFrameTreeSchema and the scenario storage frame schema.

A reply without a frame tree used to be retried for two seconds and
reported as target_not_allowed; it is now one protocol_error.

A guard test counts literal CDP command names without a result schema per
source file; the baseline can only shrink.

* fix(browser): consume parsed CDP facts across boundaries

* refactor(browser): register target, storage and acknowledgement CDP replies

Register result schemas for Target.attachToTarget, Target.getTargetInfo,
Storage.getStorageKey, Page.addScriptToEvaluateOnNewDocument,
Debugger.setBreakpointByUrl, Debugger.evaluateOnCallFrame and fourteen
commands whose reply REA reads only as success. Their callers use the
parsed reply; the per-site readers are removed (attachedSessionId and the
scenario storage and service-worker zod schemas, which threw raw ZodError).

Playwright's Target.getTargetInfo in scenario attach now goes through the
same admission. The untyped-command baseline drops from 96 to 48.
2026-11-14 23:40:44 +00:00
morluto f3b697da5a refactor(cli): derive contract-backed command options from the tool contract (#10571)
* refactor(cli): derive contract-backed command options from the tool contract

Each contract-backed CLI command restated its contract's input fields as
hand-written incur options and mapped them back to snake_case input with
conditional spreads. Nothing checked that the two schemas agreed.

Add registerContractCommand: a per-command projection names only what the
CLI spells differently (positionals, caller-relative path fields, option
renames, CLI help wording, omitted optional fields with a reason). Option
schemas, decimal argv tokens and the contract's cross-field rules are
derived from the contract input schema, and parsed options map back to the
contract input mechanically.

Migrate inspect-sqlite-database and the thirteen flat binary-diagnostics
inspectors. Their --schema output is unchanged apart from property order,
and help lists options in contract order. Delete the SQLite superRefine that
mirrored the contract and the per-command spreads.

Add a parity test: every projected command exposes each contract field or
declares its omission, and each field admits exactly what the contract
admits for empty, NUL, relative-path, bound and numeric-spelling probes.

* refactor(cli): refuse unprojected contract input forms at registration

Address review findings on the contract projection:

- Bind inspect-sqlite-database to its contract by name instead of catalog
  position.
- Accept only field forms argv can carry (string, number, boolean, enum,
  and arrays of strings or enums) instead of rejecting a short list, so
  arrays of objects, tuples and other forms fail at registration.
- Refuse root input keywords other than the projected object constraints
  and presentation annotations, so a contract rule such as `not` cannot
  disappear from --schema.

* refactor(cli): describe contract commands independently of the CLI framework

Split the contract projection into a framework-neutral description and a
thin Incur adapter, so a later REA-owned CLI layer (#10583) can render the
same description.

- contractCliDescription.ts derives each positional and option from the
  contract and projection: key and short flag, help, argv admission
  schema, boolean-flag/repeatable/decimal/caller-path facts, object
  constraints renamed to CLI keys, the optional argv-time cross-field
  check, and the mapping back to contract input.
- contractCommand.ts only renders that description as Incur args and
  options and runs the handler.

Cross-field rules now refuse at argv parsing only when a projection asks
(inspect-sqlite-database does, keeping its behavior); otherwise the
service's contract parse refuses them as before. Exact-optional fields are
projected as optional because argv cannot carry an explicit undefined and
Incur's help reads flag and choice types only through optional.

The parity guard reads the descriptions, and also checks that boolean
fields parse as bare flags and that no projected field stays
exact-optional.
2026-11-15 04:30:18 +08:00
morluto 29fb608559 refactor(rust): report cargo-auditable section failures through ParseFailure (#10652)
* refactor(rust): report cargo-auditable section failures through ParseFailure

RustAuditableFormatFailure restated the malformed/unsupported algebra and
the provider translated it by hand; container BinaryFormatFailures were
re-wrapped and lost their kind. The reader now throws ParseFailureError
(format rust-auditable), container failures propagate unchanged, and the
provider maps both through parseFailureAnalysisError. A counted guard
keeps new per-format failure classes from returning.

* test(rust): pin the container's truncated failure facts through the Rust reader
2026-11-14 15:28:33 -05:00
morluto 3e0dc29041 fix(browser): type CDP command replies and parse frame trees once (#10604)
* fix(browser): type CDP command replies and parse frame trees once

CdpConnection.send is typed by method name. A command registered in
src/browser/protocol/CdpCommands.ts has its parameters typed from the
protocol table Playwright ships and its reply parsed once by its own result
schema; a mismatch rejects that command with CdpMalformedReply
(protocol_error, command, JSON pointer) without poisoning the connection.
Playwright storage sessions admit replies through the same table.

Page.getFrameTree and Page.getResourceTree are the first registered
commands. Their one parser keeps per-frame facts tolerant (malformed child
entries remain explicit omissions) and replaces the per-site readers:
observeMainFrameUrl, mainFrameUrl, walkFrameTrees, frameTreeResources,
runtimeFrameTreeSchema and the scenario storage frame schema.

A reply without a frame tree used to be retried for two seconds and
reported as target_not_allowed; it is now one protocol_error.

A guard test counts literal CDP command names without a result schema per
source file; the baseline can only shrink.

* fix(browser): consume parsed CDP facts across boundaries
2026-11-14 15:21:00 -05:00
morluto ef1b92bf1e test(mcp): check advertised schemas against a portable dialect in every profile (#10567)
* test(mcp): check advertised schemas against a portable dialect in every profile

* fix(mcp): validate advertised dialect by selected profile

* fix(mcp): refuse zero-padded repeat bounds and record host-specific path patterns
2026-11-14 15:20:31 -05:00
morluto 85da0bd4ee refactor(errors): require a reason for every analysis cancellation (#10566)
* refactor(errors): require a reason for every analysis cancellation

Add cancelledBy, the one constructor for AnalysisCancelledError. Its
reason argument is required: an aborted signal, an earlier cancellation,
a reason carried from an inner failure, or an OwnerCancellation when REA
closed the work's owner itself.

Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and
binary-session record owners now report OwnerCancellation.ownerClosed
instead of an absent reason. Firmware's predecessor wait returns its
cancellation as a Result, removing an unreachable reason-less fallback.

An architecture guard rejects new direct constructions, with a counted
per-file baseline that can only shrink.

* refactor(errors): share one aborted-signal predicate with cancelledBy

* refactor(process): return a departing caller's reason from a shared startup wait

* refactor(providers): build decompiler-provider cancellations with a required reason (#10587)

Migrate every AnalysisCancelledError construction under src/ghidra,
src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the
guard baseline from 671 to 572. Closed Kuna target commands report
OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and
JEB close abort their lifetimes with that typed reason.

* fix(errors): read the reason of any signal-shaped cancellation source

* test(ci): cover the counted-baseline comparison behind the architecture guard
2026-11-14 15:20:03 -05:00
morluto 2f4c588584 fix(artifacts): require each reader traversal to declare its coverage (#10572)
* fix(artifacts): require each reader traversal to declare its coverage

* docs(artifacts): state that silent traversals report unknown coverage
2026-11-15 04:07:21 +08:00
morluto e53212655b refactor(contracts): derive the public tool catalog from one contract-group list (#10564)
* refactor(contracts): derive the public tool catalog from one contract-group list

toolContracts.ts and toolFamilies.ts each imported and listed the same
contract groups. toolContracts.ts now owns one ordered group object;
TOOL_CONTRACTS is its flattened values in the same catalog order, and
toolFamilies.ts reads TOOL_CONTRACT_GROUPS from it instead of re-importing
every group. The static catalog-source lint rule learns the
Object.values(groups).flat() composition so positional-contract enforcement
still discovers every group without executing modules.

* fix(lint): reject computed tool catalog groups
2026-11-15 04:07:17 +08:00
morluto d7250f5d46 refactor(ghidra): build the invalid-regex refusal with the shared owner (#10570)
Ghidra projected the bridge's invalid_regex_pattern code through an inline
copy of the refusal that RegexMatcher's invalidRegexPatternError already owns
for Kuna, Hopper and IDA. Ghidra now calls that owner, passing the bridge's
own message, which already names the pattern and Java's syntax error, as the
user message. The owner accepts error options so Ghidra keeps its cause and
diagnostics.
2026-11-14 15:03:11 -05:00
David Muñoz Rey 57150091d2 fix(ghidra): name the declared-seed recovery when no function covers an address (#10623)
Problem: code that Ghidra auto-analysis never reaches, such as DOS MZ
handlers stored only in runtime-filled dispatch tables, has no Ghidra
function. procedure_* lookups then returned a plain procedure_not_found
whose remediation pointed only at list_procedures, and
resolve_containing_procedure returned not_in_procedure with no caveat.
Neither outcome named the supported recovery: declaring the entry as a
function seed in REA_GHIDRA_SEED_FILE.

Fix: one Ghidra-owned recovery, ghidraFunctionSeedRecovery(source), names
the seed mechanism without claiming that the address holds code. It
follows the session source, because seeds apply only to a fresh import:
selected projects and owned checkpoints name the setting to unset first.
The procedure_not_found remediation appends it. A not_in_procedure
resolution now carries ghidraNotInProcedureLimitation, attached through
the same absence-caveat path as the empty-reference caveats and read from
the domain containing-procedure parser. outside_segments and found
results are unchanged. The installation guide's seed section says where
the recovery appears.

Validation: src/ghidra/GhidraProvider.behavior.test.ts fails on the base
(4 failed, 291 passed: both procedure_not_found rows lack the setting,
the selected-project row lacks the fresh-import seed recovery, and
not_in_procedure has no seed limitation) and passes after the fix
(295 passed). npm run check:fast passes. Real Ghidra, including seeding
real-mode DOS linear addresses, was not exercised.

Refs morluto/rea#3767
2026-11-14 14:52:52 -05:00
morluto c6474cc8e9 refactor(ghidra): drop the unreleased checkpoint v1 reader and a one-time pattern proof (#10560)
* refactor(ghidra): drop the unreleased checkpoint v1 reader and a one-time pattern proof

The Ghidra checkpoint manifest v1 shape and its upgrade to v2 arrived in the
same commit (c07ab4b994, first released in 6.9.0), and every release writes
v2, so no released build produced v1. A v1 manifest is now refused as
malformed and left unchanged, like any other unknown manifest.

portableSchemaPatterns.test.ts proved two advertised patterns equal the
look-ahead regexes they replaced by enumerating 90,000 strings. The lasting
invariant (no look-around in advertised patterns) is asserted catalog-wide by
advertisedPatternsVMode.test.ts for the default and full input profiles. The
current accept/refuse contract for dylib roots and the reserved process
environment name moves to the owning schema tests as small tables.

Refs #10515

* test(process): retain malformed environment name coverage
2026-11-14 14:51:45 -05:00
morluto 3fbdf0057b fix(ghidra): commit analysis profiles to the bridge script sources (#10562)
* fix(ghidra): commit analysis profiles to the bridge script sources

Snapshot reuse for Ghidra depends on the analysis profile digest, but the
profile committed only to hand-bumped semantic markers. A bridge change that
forgot to bump its marker left earlier snapshots admissible (#3664).

Add ghidraBridgeSourcesDigest, a SHA-256 over every packaged bridge source by
name, and commit it as bridge_sources_sha256 in every Ghidra profile, for new
imports and existing projects alike. A changed script now changes the profile
digest without anyone remembering a marker. Existing snapshots are not reused
once, after upgrading.

GhidraRawProfileDigest.test.ts pinned literal digests that every bridge or
marker change had to re-record; it now checks the committed parameters and
that the digest is the profile owner's digest of them. A new test checks that
the source list covers every packaged .java file.

* fix(ghidra): frame bridge digest metadata as a tuple
2026-11-14 14:51:19 -05:00
morluto e68e548a3d fix(cli): validate plist and dylib-root options with their contract fields (#10557)
* fix(cli): validate plist and dylib-root options with their contract fields

inspect-plist --relative-path and trace-dylib-resolution --root were
declared as bare strings on the CLI. --schema under-advertised them, and an
empty or NUL value reached the operation contract, whose refusal named the
contract field (path, roots) instead of the CLI option.

Declare both options with the contract's own field schemas
(localPathStringSchema; dylibResolutionInputSchema.shape.roots), so the CLI
refuses them first and names --relative-path or --root.

Fixes #9764
Fixes #9823

* fix(mcp): observe SDK initiated cleanup failures
2026-11-14 14:50:59 -05:00
morluto f5c8c1f9e0 fix(setup): derive client config roots from each client's own reader (#10596)
Configuration roots read from XDG_CONFIG_HOME, VSCODE_APPDATA and
VSCODE_PORTABLE now come from one module whose functions reproduce a named
reader: xdg-basedir (OpenCode, Kilo), the XDG rule used by Rust dirs and
etcetera (Zed, Goose), and VS Code's getUserDataPath. mcp add's ad hoc
platformPaths() is removed. Zed no longer takes a relative XDG_CONFIG_HOME
that Zed ignores, and the Cline extension and Kilo's VS Code marker follow
VS Code's portable and VSCODE_APPDATA selection.
2026-11-14 14:40:10 -05:00
morluto a09d3bed94 refactor(filesystem): hash admitted target descriptors with the shared stable hasher (#10573)
BinaryTargetResolver kept a private copy of StableFileHash's descriptor read
loop because it must hash the same descriptor it classified, admitted with
symlinks rejected, while hashStableFile opens its own descriptor and follows
symlinks. The loop is now hashStableRegularFileDescriptor, which takes the
admitted descriptor and the caller's symlink setting; readStableFile and the
resolver both use it. The resolver keeps symlinks: reject and maps a change
to its existing BinaryTargetError and cancellation to AnalysisCancelledError.
2026-11-14 14:37:30 -05:00
morluto 9ca6b41ee0 fix(setup): name client configuration syntax from one reader table (#10586)
* fix(setup): name client configuration syntax from one reader table

Each client format now maps to one reader description (syntax, strict or
JSONC, BOM and empty-file handling, strict-JSON repair). The document
parser, the strict-JSON rewrite decision and uninstall's diagnostic all
read it, so uninstall no longer re-derives a syntax name that called
Goose's YAML and JSONC-admitting clients "JSON".

* test(hopper): retry cleanup after confirmed application exit
2026-11-14 14:37:04 -05:00
morluto e83e3fa8a0 feat(errors): type refusals at the producer with a total recovery (#10577)
* feat(errors): type refusals at the producer with a total recovery

A resource refusal without authored text fell back to resource-kind advice:
a fixed parser ceiling reported as memory told the caller to add host
memory, an upstream IDA reply ceiling pointed at REA's MCP transport, and a
fixed Kuna text ceiling reported as capacity was marked retryable. An
ambiguous selector was reported as invalid input that pointed at the schema.

Add AnalysisRefusal with three variants built from facts producers already
own: fixed_ceiling (FixedAllowance, now with limit, unit and narrowing),
adjustable_budget (AnalysisSettingLimit) and ambiguous_selector (new
AnalysisInputError option). Each variant is attributed to the error's
operation and projected under details.refusal. Presentation is a total
switch over the variants, and authored text still takes precedence.

Migrate the first producers. GraphQL nesting, Playwright trace input, the
Kuna function text and the IDA upstream reply become fixed ceilings. jadx
overloads and Kuna ambiguous names become ambiguous selectors, replacing the
two Kuna-specific ambiguity texts. Seven occupied admissions declare
measuredExhaustion. The rea/typed-resource-refusal lint rule rejects new
untyped resource constraints, and the remaining 24 are counted in a baseline
that can only shrink.

* fix(errors): honor refusal recovery ownership
2026-11-14 14:36:14 -05:00
morluto a0d9025202 refactor(parsers): report format failures through one ParseFailure algebra (#10593)
* refactor(parsers): report format failures through one ParseFailure algebra

Add ParseFailure (malformed, truncated, unsupported, limit, with format,
offset and field) and its one carrier, ParseFailureError, in the domain.
BinaryReader now names truncation and the field it read, and its native
format and resource failures are ParseFailureError subclasses.

Providers projected a format failure with their own instanceof ladder,
and some dropped the selected path from the invalid_format message.
parseFailureAnalysisError now owns that projection for the native,
Go, devicetree, V8, Windows Shortcut and Electron fuse providers.
The V8 code cache, Windows Shortcut and Electron fuse format classes
are removed in favour of the algebra.

The architecture guard counts raw Buffer and DataView reads, plain
Error throws in parser folders and plain JSON.parse of parser input
against baselines that can only shrink.

* fix(parsers): retain malformed range offsets
2026-11-14 14:35:28 -05:00
morluto e939cd04fe fix(hopper): name the unconfirmed shutdown step in retained cleanup (#10594)
* fix(hopper): name the unconfirmed shutdown step in retained cleanup

When close_binary retains a Hopper document, the cleanup error lists the
retained resources but not why shutdown went unconfirmed. On Linux CI,
hopperClient.handshakeRecovery "recovers an application exit after the
first valid handshake occurs during cleanup" fails intermittently. The
vitest blob reports show only hopper-document and the runtime root
retained with authenticated_application "readable". From those facts we
cannot tell whether the shutdown request was not sent, failed, or was
sent while the application was still observed as present.

Record the shutdown request outcome (method, status, error tag and
provider state, or why it was not sent) and the final exit observation
of the authenticated application in the retained-document diagnostics.
Exit observation now reports a positively observed Linux exit in
progress (PF_EXITING before state Z) as "exiting", separate from
"present". Neither confirms exit. The flaky test asserts the projected
error, so a later failure prints these diagnostics in the CI log.

Refs #10556

* fix(hopper): retain fallback shutdown diagnostics

* test(hopper): retry cleanup after confirmed application exit
2026-11-14 14:34:52 -05:00
morluto 764203cf4a refactor(contracts): key the tool effect audit by public tool name (#10579)
TOOL_EFFECT_AUDIT was typed Record<string, EffectAudit>, so a tool missing
from the audit or a misspelled entry was found only by a runtime throw or
the key-equality unit test.

Check the audit with satisfies Record<PublicToolName, EffectAudit>, where
PublicToolName is the union of TOOL_CONTRACTS names. A missing, extra or
misspelled entry is now a compile error. String lookups for callers that
hold an unchecked name keep their runtime refusal.

Delete the unit test that compared audit keys with contract names; the
type now owns that check.
2026-11-14 14:14:27 -05:00
morluto 81c115b4c3 fix(setup): register mcp add clients from the shared client table (#10591)
Table-backed add-mcp agents now project their client-table row instead of
redeclaring format, display name and profile in a second table. The row
also carries add-mcp aliases and project documents. mcp add now applies
the read-scope rules setup already enforced: Gemini settings policy blocks,
the Claude Desktop MSIX write blocker and MSIX AppData redirection.
2026-11-14 14:14:09 -05:00
morluto a874fcc4e3 refactor(javascript): classify implicit execution in one owner (#10605)
* refactor(javascript): classify implicit execution in one owner

Add javascriptSemanticExecutionPoints, a total classification of every
runtime Babel node type into the ways its evaluation can run code without
call syntax. The member-mutation escape walk, the accessor operand
collector and the catch-source reachability check consult it instead of
their own syntax lists. Kinds those collectors have never applied are now
named in exhaustive switches rather than absent.

A guard test fails when the installed @babel/types defines a node type the
table does not classify, and unknown node types classify as unsupported
syntax rather than inert.

* test(hopper): retry cleanup after confirmed application exit

* fix(javascript): classify enumeration and catch binding effects

* fix(javascript): retain catch uncertainty for identifier reads
2026-11-14 14:13:07 -05:00
morluto 4502bd44bb fix(gdb): keep a retained cancelled startup a cancellation on cleanup retry (#10551)
A cancelled GDB startup whose process stop could not be confirmed retained a
capability error. The next cleanup retry then reported "This analysis is
unavailable for the current target" instead of the caller's cancellation.

Move Rizin's retention rule (the #5963 fix) into one shared
retainedDebuggerCleanupFailure in src/process/ownedDebuggerSession.ts and use
it from both session managers. The GDB command-cancel path now retains the
cancellation itself, so retry reports no longer depend on Set insertion order.
2026-11-14 13:28:43 -05:00
morluto eead7a5815 refactor(domain): one owner each for non-empty text schemas and UTF-8 head excerpts (#10569)
Fifteen domain schema files each declared z.string().min(1), eight of them
as boundedTextSchema although it bounds nothing. They now share
nonEmptyTextSchema from src/domain/textSchemas.ts; the one trimming copy in
reconstructionCoverage.ts is renamed trimmedTextSchema.

Three private UTF-8 prefix truncators (gdb recent MI records, rizin
diagnostics, environment replay) and src/process/boundedUtf8Text.ts are
replaced by utf8HeadExcerpt in src/domain/utf8HeadExcerpt.ts, which encodes
only the retained prefix and returns a slice of the source text.
2026-11-14 13:28:28 -05:00
gensokyo-devandgensokyo-dev 1ba93b4602 test(desktop): fail promptly when synthetic children never get ready
The fake application now leaves a marker when its children never report
ready, and the tests' session requests throw on it, so capture releases the
children and the test fails at once instead of waiting for its deadline.

Refs #10366

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 17:59:38 +01:00
gensokyo-devandgensokyo-dev a4223536d9 test(desktop): fail the synthetic app when its children never get ready
The readiness wait from the previous commit continued after its bound
even when a child had not installed its TERM trap, so a slow runner
would reintroduce the race silently. It now exits with an error after
five seconds, and the state line keeps its original escaping.

Refs #10366

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 17:59:38 +01:00
LexLuthorPrimeroandgensokyo-dev 97c7582664 test(desktop): wait for synthetic application children readiness before exercising sigterm release
Fixes #10366
Supersedes #10455

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 17:59:38 +01:00
MuhammadFaizan-progandgensokyo-dev f35b6a75b3 test(inspector): keep the cancellation fixture out of underscored temp roots
Fixes #9996

Supersedes #10118

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 17:59:38 +01:00
Nitin13-gitandgensokyo-dev c8d5413d0f fix(native): scale the NativeAOT work budget with the admitted image
The parser's work budget was a fixed 64 Mi units, so a real 26 MB .NET 8
NativeAOT image (bflat 8.0.2) stopped frozen-string recovery at 4,433 of
6,685 strings and reported partial. Give each image a base budget plus 8
units per admitted source byte, bounded by the source-byte ceiling, and
record the scaling in the analysis profile (contract revision v11). With it,
that image completes with all 6,685 frozen strings using 71.6 M units.

Only the budget scaling of #4559 is taken: main already resolves the
base-type closure in linear time.

Fixes #4445
Supersedes #4559

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:51:40 +01:00
gensokyo-devandgensokyo-dev 79097f52b2 test(native): assert the null-symbol note by its facts
Match the skipped entry's index, file offset and st_name instead of the whole
explanatory sentence.

Refs #9700

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
gensokyo-devandgensokyo-dev 46e9871e59 fix(pcap): refuse a DNS message with more than one OPT record
RFC 6891 makes a second OPT record a format error. Reading every OPT record
let a later one with extended RCODE 0 clear an earlier nonzero one, so an
error response could attribute its addresses.

Refs #10211

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
Sarthak Pandeyandgensokyo-dev bb1bb46dcb fix(native): admit the retroactive flag when decoding Swift static witnesses
A retroactive protocol conformance sets flag bit 0x40. The static
witness check admitted only the type-reference kind bits (0x38), so a
retroactive conformance lost its static witness table. The admitted
mask is now 0x78; conditional requirements, resilient witnesses and
generic witness tables stay unadmitted.

Fixes #7445

Only the mask change and its tests are taken from #7489.

Supersedes #7489

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
Rudy Celekliandgensokyo-dev 85198fd5cb fix(pe): retain TLS templates without complete file backing
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

Fixes #7400
Supersedes #7529

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
hhangandgensokyo-dev a7398cc9eb fix(elf): preserve compiler metadata after an empty kernel builder
Squashed from #9950 and rebased onto main.

Fixes #9942
Supersedes #9950

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
wunianze666-netizenandgensokyo-dev 5e1ddec2da fix(apk): validate classic ZIP disk declarations
Squashed from #7471 and rebased onto main.

Fixes #7433
Supersedes #7471

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
morlutoandgensokyo-dev 14de30ff97 fix(apple): accept historical IPS row reports
Refs #7689

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
Avocadoandgensokyo-dev 0a99147c57 fix(apple): retain unknown IPS row key names
Fixes #7689
Supersedes #7733

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
Alex Cinovojandgensokyo-dev f8f019e104 fix(pcap): preserve DNS RCODE, EDNS extended RCODE, and OPCODE status in address attribution
Fixes #10211

Supersedes #10218

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00
rodricksz4h5andgensokyo-dev 7a03182349 fix(v8): report a pre-13.4 V8 module code cache as a module
Fixes #10262
Supersedes #10263

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:31:24 +01:00