mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
093e41a5684c719c48d647717b36c74923e3d190
62
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5f718ce30e |
refactor(kernel): give error-message, byte-hex and SHA-256 hex helpers one owner in a new src/kernel layer (#11542)
* refactor(kernel): give error-to-message text one owner in a new src/kernel layer * fix(kernel): keep the regex worker's own error text inside its isolated source * refactor(kernel): exclude copies that run in another realm from the error-message guard by name The regex worker's source string and the page.evaluate fetch in PlaywrightScenarioRequest cannot import errorMessage. The guard now names them, so the counted baseline does not invite a later slice to rewrite them. * refactor(kernel): migrate the long tail of inline error-message copies to errorMessage (#11552) Every provider and adapter folder with six or fewer copies now calls errorMessage from src/kernel. Local helpers whose whole body was the copy (failureMessage, gdbErrorMessage, message, describe, reasonOf, recoveryFailureMessage and four local errorMessage definitions) are removed and their call sites call the owner. Refs #11548 * refactor(kernel): give byte-to-hex formatting one owner in src/kernel (#11560) byteToHex returns the two lowercase hexadecimal digits of one byte. All eight inline copies (native, contracts, domain firmware and desktop, pcap) call it, keeping their own 0x, % or \x notation, and a counted guard with an empty baseline keeps new copies out. Refs #11548 * refactor(kernel): give one-shot SHA-256 hex digests one owner in src/kernel (#11562) sha256Hex digests one in-memory value. A counted guard records the one-shot createHash("sha256").update(x).digest("hex") chains (115 in 101 files) and the first slice migrates domain, contracts and process (35 copies), removing local wrappers (sha256, sha256Text, hash) and the exported sha256Text. Incremental and streamed hashing is not counted. Refs #11548 * refactor(kernel): migrate the application layer's inline error-message copies to errorMessage (#11563) All 69 copies in src/application call errorMessage from src/kernel. Local helpers whose whole body was the copy (errorDetail, causeReason and five local errorMessage definitions) are removed and their call sites call the owner. Refs #11548 * refactor(kernel): migrate the native provider's inline error-message copies to errorMessage (#11567) All 49 copies in src/native call errorMessage from src/kernel. The local errorReason helpers in LldbCallTracer and LldbRetainedObservations, whose whole body was the copy, are removed and their call sites call the owner. Refs #11548 * refactor(kernel): migrate the remaining inline error-message copies to errorMessage (#11569) |
||
|
|
76117c04f3 | refactor(domain): give the Ghidra seed file format a domain owner shared with il2cpp (#11515) | ||
|
|
7f61563cae | refactor(domain): move the binary image, Mach-O selection and fixup readers into domain (#11482) | ||
|
|
cef87c498a |
refactor(architecture): add the ports and resources layers, move ports and shared resource owners there, and ratchet the layer baseline (#11208)
* test(architecture): fail on a stale layer baseline and document the declared layers verify:module-boundaries reported a layer baseline entry whose imports were gone but still passed, so main kept process -> artifacts at 20 after it fell to 17 and a later change could add three imports back unnoticed. A stale entry now fails like growth; --shrink-layer-baseline lowers it in the change that removes the imports. The architecture map and CONTRIBUTING name scripts/lib/module-layers.mjs as the per-directory layer declaration. * test(architecture): refuse to lower the layer baseline after an inspection failure A file that cannot be parsed contributes no imports, so a shrink run would record counts that fail as growth once the file is fixed. Whole-command tests cover stale rejection, shrinking, refused growth and the inspection failure. * refactor(ports): move the progress, work-scope and inspection-scope ports to src/ports (#11214) * refactor(ports): move the progress, work-scope and inspection-scope ports to src/ports Pure move with git mv and import specifier updates. * test(architecture): declare the ports layer and lower the layer baseline src/ports sits between the foundation and the providers. Moving the three ports removes 11 provider -> application imports. * refactor(ports): move AnalysisProvider to src/ports (#11217) * refactor(ports): move AnalysisProvider to src/ports Pure move with git mv and import specifier updates in its importers, the built-fixture path, the CI scope glob and the lint-rule test spellings. * test(architecture): lower the layer baseline after moving AnalysisProvider * refactor(ports): move the per-feature provider ports to src/ports (#11226) * refactor(ports): move the per-feature provider ports to src/ports Pure move with git mv and import specifier updates: the 47 *Port.ts and *Ports.ts files that providers implement, plus OptionalObservationProviders, which only composes the observation ports. * test(architecture): lower the layer baseline after moving the feature ports * refactor(providers): move closeAnalysisClient and the Frida session input errors to their owners (#11233) * refactor(providers): move closeAnalysisClient to src/providers and the Frida session input errors to src/frida Pure move with git mv and import specifier updates. * test(architecture): drop the application-providers and application-frida cycles from the layer baseline * fix(ci): keep provider lanes selecting the ports moved to src/ports Each lane glob that matched a moved port under src/application gains its src/ports counterpart; the change-scope test pins one moved port per lane. * refactor(domain): declare the localPath host exception and read HOST_PLATFORM there (#11256) absoluteLocalPathStringSchema decides which paths are absolute on the running host, so it reads HOST_PLATFORM instead of process.platform. Domain may not import outside domain/contracts; module-layers now declares LAYER_EXCEPTIONS, exact file-to-file imports with a reason, and both the layer count and the pure-layer boundary skip only that import. Any other domain -> platform import still fails. * refactor(ports): move the doctor check and provider inspection types to src/ports (#11246) * refactor(ports): move the doctor check and provider inspection types to src/ports Declaration move from application/Doctor.ts (unchanged text) and import updates; no re-export from Doctor.ts. * test(architecture): lower the layer baseline after moving the doctor provider types * refactor(ports): move the packet capture and signal recording ports to src/ports (#11249) * refactor(ports): move the packet capture and signal recording ports to src/ports Declaration move (unchanged text) out of the two application services, with import updates. * test(architecture): lower the layer baseline after moving the capture and signal ports * refactor(domain): move the analysis error projection schema from contracts to domain (#11251) * refactor(domain): move the analysis error projection schema from contracts to domain Declaration move (unchanged text) of the projection schemas that domain modules embed; contracts/errorSchemas.ts keeps the CLI envelope and the published JSON Schema. Import updates only. * test(architecture): drop the contracts-domain cycle from the layer baseline * refactor(ports): drop the imports the moved capture, signal and doctor types left behind Also give the packet capture and signal recording lanes the new port paths, with change-scope cases. * refactor(resources): add src/resources and move AnalysisCleanupLease and ArtifactReader there (#11259) * refactor(resources): move AnalysisCleanupLease to src/resources Pure move: git mv plus import specifier rewrites (source, tests, and the dist paths the verifier scripts load). * refactor(resources): declare src/resources as a foundation unit src/resources owns the shared analysis resource modules that process, windows and providers hold; AnalysisCleanupLease is the first. Its tests join the adapters project, the apk signature lane selects it beside src/artifacts, and the layer baseline drops the process and windows imports of the lease. * test(ci): pin the apk signature lane on the moved cleanup lease * refactor(resources): move ArtifactReader to src/resources Pure move: git mv plus import specifier rewrites (source, tests, and the dist path a verifier script loads). * test(architecture): lower the layer baseline after moving ArtifactReader windows no longer imports src/artifacts; process -> artifacts 11 -> 9. The CI lanes that selected src/artifacts/ArtifactReader.ts select its new path, pinned in the change-scope test. * refactor(resources): move ArtifactResourceScope to src/resources (#11265) * refactor(artifacts): name the output tree and private root capabilities the resource scope releases ArtifactResourceScope typed its output-tree and private-runtime-root owners with SafeOutputTree (src/artifacts) and PrivateRuntimeRoot (src/process). It only calls rollback() and close(), so it now declares those capabilities itself and names neither unit, which lets it move to src/resources without a resources <-> process cycle. The withheld-export test narrows to SafeOutputTree where it reads the published flag. * refactor(resources): move ArtifactResourceScope to src/resources Pure move: git mv plus import specifier rewrites (source, tests, the dist paths verifier scripts load, and the FIFO probe's module-relative URL). * test(architecture): lower the layer baseline after moving ArtifactResourceScope process -> artifacts 9 -> 5, and the artifacts <-> dotnet mutual pair is gone. The sqlite and agentenv lanes select the scope at its new path, pinned in the change-scope test. * refactor(resources): move ArtifactFileOperation to src/resources (#11269) * refactor(resources): move ArtifactFileOperation to src/resources Pure move: git mv plus import specifier rewrites (source, tests, and the dist paths verifier scripts load). * test(architecture): lower the layer baseline after moving ArtifactFileOperation process -> artifacts 5 -> 1. * refactor(resources): move readStableArtifact to src/resources (#11271) * refactor(resources): move readStableArtifact to src/resources Pure move: git mv plus import specifier rewrites. * test(architecture): lower the layer baseline after moving readStableArtifact process no longer imports src/artifacts: process -> artifacts 1 -> 0 and the artifacts <-> process mutual pair is gone. The seven lanes that selected readStableArtifact select its new path, pinned in the change-scope test; the architecture map lists what src/resources owns. * refactor(hopper): take Linux launcher verification from composition through a port (#11278) The Hopper launcher imported inspectLinuxHopperLauncher and retryLinuxHopperPublisherCleanup from src/application (the two hopper -> application imports). src/ports/LinuxHopperLauncherVerification.ts now names that capability; src/application/LinuxHopper.ts provides LINUX_HOPPER_LAUNCHER_VERIFICATION, binary composition passes it to HopperProvider, and the provider hands it to the launcher. A launcher built without one refuses a Linux demo launch with reason verification_unavailable before running the launcher. Layer baseline: hopper -> application 2 -> 0. * refactor(config): move Hopper launcher discovery to a src/hopperPaths foundation unit (#11292) * refactor(hopper): move the launcher discovery and macOS Hopper paths to src/hopperPaths Pure move: git mv plus import specifier rewrites. * refactor(hopper): declare src/hopperPaths as a foundation unit with the Linux launcher candidates Hopper install paths and launcher discovery are pure path facts that the Hopper provider, doctor and setup all read. Declare src/hopperPaths in the foundation layer, add it to the adapters test project, the architecture map and the package-baseline CI lane, and move the Linux launcher candidates out of src/application/LinuxHopper.ts into src/hopperPaths/LinuxHopperPaths.ts so discovery no longer imports application code. * refactor(config): leave Hopper launcher discovery to the Hopper provider parseConfig resolved an unset HOPPER_LAUNCHER_PATH by probing the filesystem through application-owned discovery, so config imported application (config -> application 2, application <-> config cycle) and read process.platform ambiently. AppConfig.hopperLauncherPath is now the caller's HOPPER_LAUNCHER_PATH unchanged (string | undefined). src/hopperPaths/HopperLauncherDiscovery.ts owns the selection (selectedHopperLauncherPath: the configured spelling, else discovery from the caller environment's home on the provider's platform); HopperProvider and the two real-Hopper verifiers read it. Discovery tests move from config.test.ts to src/hopperPaths; a provider test covers discovery from the provider's own platform and home. Module layers: config -> application 2 -> 0; application <-> config removed. Architecture guards: ambient platform reads in parseConfig.ts 2 -> 0. * refactor(providers): move owned-process prerequisite availability out of application (#11294) * refactor(providers): move the owned-process prerequisite availability mapping to src/providers Pure move: git mv plus import specifier rewrites. * test(architecture): lower the layer baseline after moving owned-process availability android -> application 1 -> 0; apktool -> application 1 -> 0. * refactor(process): move the regular-file read owner out of application (#11299) * refactor(process): move the regular-file read owner from src/application to src/process Pure move: git mv plus import specifier rewrites. * test(architecture): lower the layer baseline after moving the regular-file read owner desktop -> application 5 -> 4; dotnet -> application 2 -> 1. The agentenv lane listed src/application/RegularFileRead.ts. At its new path it is a src/process/ shared boundary: fast qualification selects the code and runtime checks (and the single owning lane, web_source_map, via src/process/**), and full qualification selects every lane, as for every other src/process/ module. A second owner entry would only suppress the web_source_map selection, so the agentenv entry is removed, not renamed. * refactor(resources): give atomic text writes their own owner (#11302) * refactor(resources): give atomic text writes their own owner in src/resources src/application/JsonFiles.ts owned both JSON input reads and the atomic text write (writeTextFile / writeTextParts and their staged-output publication). The write side depends only on domain, filesystem and resource owners, but il2cpp's Ghidra seed writer had to import application to reach it (il2cpp -> application). Move the write side verbatim to src/resources/TextFileWrite.ts (TextWriteCancellation, writeTextFile, writeTextParts and their private staging, publication and failure classification helpers). JsonFiles keeps the JSON read owner and reads the shared errno-to-reason classifier (fileAccessFailureReason) from the write owner instead of a copy. Importers (il2cpp seed writer, evidence bundle files, desktop build solves, analysis snapshot files and four boundary tests) read the new path; no re-export is left in JsonFiles. * test(architecture): lower the layer baseline after moving the text write owner il2cpp -> application 1 -> 0. * refactor(ports): move the desktop build host contract to src/ports (#11303) * refactor(domain): move the setup cancellation check from src/application to src/domain Pure move: git mv plus import specifier rewrites. * refactor(ports): move the desktop build host contract to src/ports The desktop provider implements doctor's desktop build facts reader and setup's desktop build host, but the contract it implements lived in application (DesktopBuildDoctor, SetupDesktopBuild, Doctor's clientRegistrations signature, ClientRegistrationEnvironment's setting types), so desktop imported application four times and the two units were a recorded mutual pair. src/ports/DesktopBuildHost.ts now holds that contract, moved verbatim: DesktopBuildCommand, DesktopBuildFacts, DesktopBuildFactsInput, DesktopBuildSetupFacts, DesktopBuildSetupHost, RecordedProviderSettings and OwnedProviderSetting. Two names are new: DesktopBuildRegistration, the registration facts the host reads (client, command and the recorded-settings names; client registration status satisfies it), and DesktopBuildRegistrationReader, which replaces DoctorHost["clientRegistrations"] in the setup host. The facts input's registration reader returns DesktopBuildRegistration instead of the full application status; the setup facts' settings are spelled Readonly<Record<string, string>> (SetupProviderEnvironment's definition). Application imports the types from the port; no re-export is left. * test(architecture): lower the layer baseline after the desktop build host port desktop -> application 4 -> 0; the application <-> desktop mutual pair is gone. * refactor(domain): define the resolved app bundle resource root beside its schema (#11304) * refactor(domain): define the resolved app bundle resource root beside its provenance schema ResolvedAppBundleResourceRoot (an app directory's resource-only identity) is a pure type over BundleResourceRoot's layout, but it lived in src/application/AppBundleExecutable.ts, so the native and artifact providers that receive it imported application. Move the interface verbatim to src/domain/apple/bundleResourceRoot.ts, which owns BundleResourceRoot, and point its eight readers there (native macOS provider and plist source, artifact provider, binary composition, and the binary session, status, port and bundle-resource session). The resolver that produces it stays in application. * test(architecture): lower the layer baseline after moving the resource root type native -> application 2 -> 0; artifacts -> application 2 -> 1 (the artifact provider still constructs BundleResourceSession). * refactor(config): move the pwntools input bound parser to src/config (#11306) * refactor(config): move the pwntools input bound parser from src/native to src/config Pure move: git mv plus import specifier rewrites, and the module path in docs/design/rea-limit-inventory.md (table realigned by oxfmt). * test(architecture): lower the layer baseline after moving the pwntools input bound config -> native 1 -> 0. The binary_layout and recorded_crash lanes, which select src/native/pwntools/**, also select src/config/pwntoolsInputLimit*.ts; ciChangeScope.test.ts pins both. * refactor(filesystem): move REA cache directory helpers out of config (#11309) * refactor(filesystem): move the REA cache directory and lexical directory helpers from src/config to src/filesystem Pure move: git mv plus import specifier rewrites. * test(architecture): drop the config and filesystem cycle from the layer baseline config no longer imports filesystem; filesystem still reads the Windows ChangeTime settle budget from config. * refactor(windows): break the process and windows import cycle (#11317) * refactor(domain): move the runtime-control and private-runtime-root refusals from src/process to src/domain Pure move: git mv plus import specifier rewrites (including the dist path scripts/verify-windows-native.mjs loads). * refactor(windows): type Job Object cleanup by what a Windows job reports WindowsOwnedProcess.cleanup() returned process-ownership's ProcessCleanupResult, so src/windows imported src/process for a type while process imports windows to supervise Windows trees. A Job Object stop only ever reports settled-and-signalled or a reason it did not settle; name that subset WindowsJobCleanupResult in windows. It stays assignable to ProcessCleanupResult, so the process supervisor reads it unchanged. * test(architecture): drop the process and windows cycle from the layer baseline * test(architecture): ratchet cross-provider imports and imports past a provider entry (#11386) * test(architecture): ratchet cross-provider imports and imports past a provider entry A provider folder may import the domain, contracts, foundation and ports layers, the shared provider core (src/providers) and its own files; an import of another provider folder is a recorded exception. Application, composition and the CLI/MCP adapters reach a provider only through src/<provider>/index.ts. verify:module-boundaries counts both kinds of import per unit pair in the layer baseline (crossProvider, providerEntry); like the upward counts they may only shrink, and a pair missing from the baseline fails. * refactor(resources): move StableArtifactFailure and StableArtifactObservation into src/resources (#11387) * refactor(resources): move StableArtifactFailure and StableArtifactObservation into src/resources Providers project stable-read failures through StableArtifactFailure next to the other shared provider toolkit owners (ArtifactReader, ArtifactResourceScope, ArtifactFileOperation, AnalysisCleanupLease, readStableArtifact) that already live in src/resources. Under src/artifacts it made every provider that reads a stable artifact import the artifacts provider. Pure move: git mv plus import specifier and baseline updates; the layer baseline drops the provider-boundary counts the move removes. * refactor(resources): reach the shared provider toolkit through src/resources/index.ts (#11390) * refactor(resources): import the shared provider toolkit through src/resources/index.ts Adds src/resources/index.ts, which exports the toolkit names that production code outside src/resources uses, and rewrites those importers (420 files) to import from it, merging each importer's toolkit imports into one declaration. Mechanical: import declarations only. * test(architecture): reach src/resources only through its entry file verify:module-boundaries now counts any production import of a src/resources file other than src/resources/index.ts, from any unit, with the imports past a provider entry. The count is renamed from providerEntry to entry ("import past the entry file"); it may only shrink, and src/resources starts at zero. * test(architecture): cover provider boundary counts through the verifier command * refactor(resources): move the safe output tree and artifact path owners into src/resources (#11398) * refactor(resources): move the safe output tree and artifact path owners into src/resources SafeOutputTree (with its admission, creation failure, readback, cleanup and identity files), StreamBytes, ArtifactPaths and readArtifactFileChunks depend only on domain, filesystem, platform and the toolkit, and browser, firmware, ghidra, javascript, android and apktool use them to publish outputs. Under src/artifacts every such provider imported the artifacts provider. Pure move: git mv, importers moved onto src/resources/index.ts (names added to the entry), the moved files import toolkit modules directly, path keys in the CI scopes and guard baseline follow the move, and the layer baseline drops the removed imports. * test(architecture): give the shared provider core its own layer below the providers (#11401) src/providers (deferred client owners and failure attribution) now imports only domain, ports, process, filesystem and the resources toolkit. Declaring it as the providerCore layer, between ports and providers, makes any import from it into a provider folder an upward import that verify:module-boundaries rejects, and lets every unit in the providers layer be a provider folder. * test(architecture): declare each provider's entry files instead of a provider barrel (#11407) * chore: ignore the source map parser move (#11348) in blame * test(architecture): declare inspector's use of the browser CDP client as a provider dependency (#11420) |
||
|
|
264dcd5fee |
refactor(artifacts): break the artifacts-firmware and artifacts-gpu import cycles (#11331)
* refactor(domain): move BinaryContainer into src/domain BinaryContainer imports only domain modules and is shared by artifacts, firmware, gpu, go, il2cpp, python, rust and native. Living under src/native made artifacts and firmware import native for its failure types and BinaryReader. Pure move: git mv plus import specifier updates. * refactor(firmware): move the devicetree parser into src/domain/firmware The FIT artifact reader in src/artifacts parses embedded devicetree blobs with the parser that lived under src/firmware, while firmware's providers import src/artifacts: the two units imported each other. The parser and its fixture are pure and now sit beside domain/firmware/devicetree.ts. Pure move: git mv plus import specifier and baseline key updates. * refactor(artifacts): break the artifacts-gpu import cycle (#11335) * refactor(artifacts): move the LZ4 block decoder into src/artifacts Pure move: git mv plus import specifier updates. The next commit removes its GPU-specific budget. * refactor(artifacts): take the LZ4 output budget from the caller decodeLz4Block bounded every decode by the GPU object budget and threw through rejectGpu, so UnityFS decoding in src/artifacts imported src/gpu while gpu imports artifacts. Callers now pass their budget: GPU payloads keep GPU_OBJECT_BYTES; UnityFS passes its 64 MiB block bound, which its size checks already enforce before decoding. Malformed blocks still throw BinaryFormatFailure with the same messages. * test(architecture): drop the artifacts-firmware and artifacts-gpu cycles from the layer baseline * refactor(artifacts): move the PE resource reader into src/artifacts/pe (#11347) refactor(artifacts): move the PE resource layout and parser into src/artifacts/pe The Node SEA and Deno standalone readers in src/artifacts locate PE resources with the layout and parser that lived under src/native/pe, while those modules already read through src/artifacts (ArtifactReaderFailure, assertArtifactReadActive). Pure move: git mv plus import specifier, baseline key and spec path updates. |
||
|
|
29dd58c96d |
fix(il2cpp): resolve ELF ABS64 and GLOB_DAT image definitions (#11075)
Derive bounded ELF ABS64 and GLOB_DAT link-image values for IL2CPP module scanning while preserving the default conservative relocation policy. Retain ambiguous hash declarations, validate complete hash-table mappings, and disclose runtime-binding limitations in CLI and MCP evidence. Validation: 408 focused tests, check:fast and docs:check passed. Public CLI/MCP and independently linked ARM64/x86-64 ELF arithmetic were checked; the original Unity binaries remain unavailable. Refs #10478 Related: #10495 Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
cabd56ea71 |
refactor(domain): give strict UTF-8 decoding one owner with an explicit BOM policy (#10728)
* refactor(domain): give strict UTF-8 decoding one owner with an explicit BOM policy * fix(domain): keep the leading-BOM behaviour every migrated UTF-8 decoder had * refactor(domain): read the domain layer's strict UTF-8 through the BOM-policy owner (#10803) Twelve domain decoders built their own fatal TextDecoder with ignoreBOM: true. They now use strictUtf8Decoder("preserve"), which keeps that behaviour: each reads bytes where a leading U+FEFF is content (binary-format names and fields, JSON and XML read byte-for-byte, recorded bodies, registry seeds whose kept bytes are re-emitted). The counted baseline drops from 74 to 62. * refactor(artifacts): read artifact readers' strict UTF-8 through the BOM-policy owner (#10871) Fourteen artifact reader modules (17 sites) built their own fatal TextDecoder. They now take it from strictUtf8Decoder with the policy each had: every one kept a leading BOM (ignoreBOM: true), so they use "preserve"; JavaScriptArtifactFiles keeps it for JavaScript and HTML entries and strips it otherwise, as before. The strict-utf8-decoder baseline drops those 17 sites. * refactor(domain): drop TextDecoder imports left by the strict UTF-8 migration * refactor(application): read MCP registration metadata through the strict UTF-8 owner * refactor(formats): read binary-format readers' strict UTF-8 through the BOM-policy owner (#10903) * refactor(formats): read binary-format readers' strict UTF-8 through the BOM-policy owner * refactor(formats): drop the model readers' unused TextDecoder imports * refactor(browser): read browser capture and fetch strict UTF-8 through the BOM-policy owner (#10935) * refactor(browser): read browser capture and fetch strict UTF-8 through the BOM-policy owner * refactor(native): read LLDB and Mach-O name strict UTF-8 through the BOM-policy owner (#10936) * refactor(native): read LLDB and Mach-O name strict UTF-8 through the BOM-policy owner * refactor(process): read MCP and NDJSON transport frames' strict UTF-8 through the BOM-policy owner (#10937) * refactor(process): read MCP and NDJSON transport frames' strict UTF-8 through the BOM-policy owner * refactor(application): read JSON and file inputs' strict UTF-8 through the BOM-policy owner (#10938) * refactor(application): read JSON and file inputs' strict UTF-8 through the BOM-policy owner * refactor(providers): read IDA, Electron, Ghidra and reference strict UTF-8 through the BOM-policy owner (#10939) * refactor(providers): read IDA, Electron, Ghidra and reference strict UTF-8 through the BOM-policy owner * refactor(evm): read the hex bytecode carrier's strict UTF-8 through the owner and refuse new local decoders (#10940) * refactor(evm): read the hex bytecode carrier's strict UTF-8 through the BOM-policy owner * chore(architecture): match local strict UTF-8 decoders in any option order |
||
|
|
63b0426e40 |
fix(errors): rethrow internal invariant violations from plist consumers and the native output projection (#11029)
* fix(plist): rethrow internal invariant violations from plist consumers KeyedArchiveReader reported any non-limit decode failure as a format failure, InterfaceBuilderAnalysis listed it as an invalid archive, ReleaseExposureReader fell back to scanning raw bytes, and the native plist parser reported it as provider output. An InternalInvariantError is a REA defect, not evidence about the input, so each consumer now rethrows it. The native parser's binary path now shares its one cause projection instead of a duplicate. * fix(native): rethrow internal invariant violations from the native output projection nativeOutputFailure wrapped any producer failure as AnalysisOutputError, so a REA defect thrown while reading a plist or dispatching a command was reported as native output parsing. It now rethrows InternalInvariantError, which reaches the provider's adapter-failure path with the invariant as its cause. * fix(artifacts): rethrow internal invariant violations from the shared artifact failure mapper translateArtifactFailure turned every unrecognised cause into an ArtifactOperationError with reason io, so the keyed-archive and Interface Builder rethrows still reached users as artifact read failures. The shared mapper now rethrows InternalInvariantError, and the deferred client reports it as a ProviderAdapterError. Provider-level tests drive both operations through that client. * refactor(dotnet): report managed reader defects through invariantViolation (#11030) * refactor(dotnet): report managed reader defects through invariantViolation The managed readers threw plain TypeError and RangeError for states their callers rule out: an allowance or method page outside the input schema, a missing snapshot after identity admission, and a missing CLI header after the caller already returned for it. These are REA defects, not malformed targets, so they throw invariantViolation. The two CLI re-checks are gone: the callers pass the CLI header they already narrowed. The dotnet parser-plain-throw baseline drops from 6 to 0. * refactor(providers): refuse unusable tool paths and record marker mismatches without throwing to their own catch (#11031) * refactor(firmware): refuse unusable tool paths without throwing to its own catch resolveFirmwareCommand threw a plain TypeError for a configured engine or limiter path that is not a regular file, only to catch it in the next line and wrap it as an unavailable capability. A helper now returns why a path cannot run, and each caller builds the one refusal directly. Refusal reasons are unchanged; the directory tests now pin them exactly. The firmware parser-plain-throw baseline drops from 2 to 0. * refactor(pwndbg): refuse unusable debugger paths without throwing to its own catch inspectPwndbgCore threw plain Errors for a relative or wrong-kind configured path only to catch them and wrap them as an unavailable capability. A helper now returns why a path cannot be used, with any host error as its cause, and the loop builds the one refusal. Cancellation between host checks still propagates. Refusal reasons are unchanged. The PwndbgCoreContext parser-plain-throw baseline entry is removed. * refactor(pwntools): record a mismatched failure marker without throwing to its own catch readPwntoolsFailureEvidence threw a plain Error when the private bridge marker disagreed with the exit status, only to catch it and record its message as the marker failure. The mismatch is now recorded directly. The recorded evidence is unchanged; a unit test pins both the matching and the mismatched marker. The PwntoolsResourceLimits parser-plain-throw baseline entry is removed. * fix(android): report an unobserved Java probe as a REA defect, not a Java refusal (#11032) * fix(android): report an unobserved Java probe as a REA defect, not a Java refusal When runOwnedCommand resolved without observing the completed run, the probe threw a plain Error that its catch then classified as a Java runtime refusal, telling the caller to review their launcher. The state is a broken internal assumption, so the probe throws invariantViolation and projects it as a jadx adapter failure. The JadxJavaProbe parser-plain-throw baseline entry is removed. * refactor(native): report native provider defects through invariantViolation (#11033) * refactor(native): report native provider defects through invariantViolation Native providers threw plain Error and TypeError for states their own earlier steps rule out: a client with no target, a measured slice with no selection, a read longer than requested, a decoder command without its runtime, an LLDB root released before its children, and an IPS integer fact from another reader. These are REA defects, so they throw invariantViolation. NativeUiInterruptionControl no longer needs a throw: recording the deadline interruption returns the interruption its error is built from. Six native parser-plain-throw baseline entries drop. * refactor(native): report malformed lipo, swift-demangle and UI helper output through ParseFailure (#11034) * refactor(native): report malformed lipo and swift-demangle output through ParseFailure The lipo and swift-demangle output parsers threw plain TypeError for output that breaks their framing, and the lipo result classifier caught every TypeError as malformed output, so a host TypeError from a REA defect was reported as lipo output. Both parsers now throw malformedInput with their own format, and the lipo classifier accepts ParseFailureError instead of TypeError. Messages and the consumers' output and format failure categories are unchanged. Four native parser-plain-throw baseline entries drop. * refactor(native): report the UI helper's non-JSON output through ParseFailure The native UI helper runtime threw a plain Error when the helper's stdout was not JSON. It now throws malformedInput with its own format and the JSON failure as cause. The observation boundary still reports it as a native-macos adapter failure with the same reason. The NativeUiHelperRuntime parser-plain-throw baseline entry is removed. * refactor(verify): keep process-lifecycle owners out of the parser plain-throw guard (#11035) * refactor(verify): keep process-lifecycle owners out of the parser plain-throw guard JadxWorkspaceRoot and PwntoolsDecoder sit in parser folders but own a private helper process; their remaining plain throws report the helper's startup, handshake and cleanup outcomes, not parse faults. The guard now names them as process-lifecycle owners and leaves them out, so their five baseline entries drop without inventing parse errors for process failures. * refactor(parsers): report the remaining artifact, il2cpp, model and domain defects through invariantViolation (#11036) * refactor(parsers): report the remaining artifact, il2cpp, model and domain defects through invariantViolation Nine plain Error, TypeError and RangeError throws in parser folders reported broken internal assumptions or caller contracts (an uninitialized ZIP or DMG reader, a missing scan result, a non-byte stream chunk, an invalid traversal or marshal limit, a header count or linking fact the reader itself should have produced, a misordered Safetensors budget, an append after fingerprinting). None is an input fault, and no catch site depends on their class. They now throw invariantViolation with the same messages, and their parser-plain-throw baseline entries drop. * refactor(evidence): refuse an earlier Evidence format through ParseFailure (#11037) * refactor(evidence): refuse an earlier Evidence format through ParseFailure UnsupportedEvidenceFormatError restated the ParseFailure algebra as its own TypeError subclass. The format owner now throws unsupportedInput for the evidence-bundle format at the evidence_format field and exports the predicate its consumers use. The bundle reader's unsupported-format kind and message are unchanged. The snapshot reader surfaced only TypeError messages, so it now also surfaces the format refusal and keeps its recreate guidance; a boundary test pins that. * refactor(native): report Mach-O reader and inspection defects through invariantViolation (#11042) The Mach-O inspection plan reads the lipo, nm and dyld_info captures it just ran, the dispatch metadata reader is called only for Mach-O executables, and the command-name reader takes limits its callers derive. A missing capture, a non-Mach-O target or a malformed limit is a REA defect, not an input fault, so these six sites throw invariantViolation with their existing messages instead of TypeError. No catch site depends on their class. Their parser-plain-throw baseline entries drop. * fix(artifacts): join the Interface Builder cleanup failure to a catalog defect When catalog work failed while the concurrent Interface Builder reader failed to close, analyzeAppleAssetCatalogs built the primary through translateArtifactFailure before joining cleanup. That mapper now rethrows an InternalInvariantError, so a defect skipped the join and the reader's retained resources were lost. The defect now becomes the artifact graph provider's adapter failure at that site and joins the cleanup failure as before. |
||
|
|
557bf41c2c |
refactor(macho): select slices through one owner with typed refusals (#10874)
* refactor(macho): name load-command codes through the shared LC table * refactor(macho): name version-min and string commands through the shared tables * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure (#10760) * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure * refactor(xml): type XML parse failures as malformed or unsupported only * refactor(parsers): catch per-format document and source failure classes (#10794) * refactor(parsers): report apktool strings and XML plist source failures through ParseFailure * refactor(apktool): drop the unused ParseFailureError import * refactor(native): select ELF sections through the keyed owner * test(native): pin returned exports and versions for repeated version sections * refactor(nativeaot): read neither of repeated frozen object regions (#10790) * refactor(nativeaot): read neither of repeated frozen object regions through the keyed owner * refactor(parsers): retire every first-match section lookup (#10793) * fix(nativeaot): report an ambiguous frozen object region as partial (#10812) * refactor(native): select program headers and load commands through the keyed owner (#10827) * refactor(native): select the GOT base and dependency segments through the keyed owner (#10847) * refactor(native): select the GOT base and dependency segments through the keyed owner resolveGotBase selects the SHT_DYNAMIC section and the allocated .got.plt/.got sections with uniqueKeyed, so a repeat leaves the GOT base unknown instead of taking the first match; elfDependencies reads PT_LOAD segments through the same keyed program table as PT_DYNAMIC. A new keyed-first-match guard recognizes a find/findLast or filter-then-[0] whose predicate compares a key field, whatever the table is called; existing matches are baselined. The unwind fixture can declare PT_DYNAMIC headers and repeated .dynamic/.got.plt sections. * test(native): pin the PT_DYNAMIC path and destructured keyed lookups The keyed-first-match guard moves to scripts/verify/keyed-first-match.mjs with focused tests, and now recognizes a destructured key in any position and a destructured filter predicate. The single PT_DYNAMIC unwind test declares .dynamic as SHT_PROGBITS so only the program header supplies DT_PLTGOT, and asserts the resolved ranges. * fix(macho): refuse repeated chained-fixup and dyld-info tables (#10850) parseMachoLayout kept the last LC_DYLD_CHAINED_FIXUPS range and merged the rebase/bind streams of every LC_DYLD_INFO(_ONLY) command. A repeat now refuses the slice as malformed. NativeMachoInspection's chained import-name reader already declined repeated LC_DYLD_CHAINED_FIXUPS; that rule is now covered by a test. * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes (#10818) * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes * refactor(plist): report property-list and keyed-archive failures through ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first. * test(plist): expect the nesting limit as its ParseFailure carrier * fix(verify): count a filter index only on the filter's own result * refactor(macho): select slices through one owner with typed refusals * refactor(keyed): select FIT properties and certificate extensions through uniqueKeyed * refactor(keyed): key each FIT node once, pin repeated FIT properties and subjectKeyIdentifiers, and type the unknown Mach-O header as unsupported * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation (#10895) * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation * fix(plist): report a cut-short NIB header or plist length record as truncated * fix(native): project the selected Mach-O's parse failures through the shared owner nativeMachoSourcePrimary mapped every non-limit ParseFailureError to AnalysisOutputError, so a malformed or truncated selected Mach-O was reported as unreadable tool output and an unsupported one lost its category. It now uses parseFailureAnalysisError like the ELF, Go and other byte-format providers: malformed and truncated bytes are an invalid path, unsupported bytes an unsupported target, and a limit still falls through to its producer's budget. |
||
|
|
78fd365bdd |
refactor(macho): name load-command codes through the shared LC table (#10714)
* refactor(macho): name load-command codes through the shared LC table * refactor(macho): name version-min and string commands through the shared tables * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure (#10760) * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure * refactor(xml): type XML parse failures as malformed or unsupported only * refactor(parsers): catch per-format document and source failure classes (#10794) * refactor(parsers): report apktool strings and XML plist source failures through ParseFailure * refactor(apktool): drop the unused ParseFailureError import * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes (#10818) * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes * refactor(plist): report property-list and keyed-archive failures through ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first. * test(plist): expect the nesting limit as its ParseFailure carrier * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation (#10895) * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation * fix(plist): report a cut-short NIB header or plist length record as truncated * fix(native): project the selected Mach-O's parse failures through the shared owner nativeMachoSourcePrimary mapped every non-limit ParseFailureError to AnalysisOutputError, so a malformed or truncated selected Mach-O was reported as unreadable tool output and an unsupported one lost its category. It now uses parseFailureAnalysisError like the ELF, Go and other byte-format providers: malformed and truncated bytes are an invalid path, unsupported bytes an unsupported target, and a limit still falls through to its producer's budget. |
||
|
|
a090fa7098 |
fix(il2cpp): report the exceeded native-link maximum in the public refusal (#10741)
* fix(il2cpp): report the exceeded native-link maximum in the public refusal * fix(il2cpp): report each native-link budget's maximum in the unit its producer counts * refactor(elf): report pointer relocation failures through ParseFailure (#10748) |
||
|
|
3a29b6b8ea | refactor(il2cpp): report format failures through ParseFailure (#10701) | ||
|
|
89640a446a |
fix(parsers): stop reading every RangeError as a format failure (#10602)
* 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): stop reading every RangeError as a format failure Mach-O, Swift and Objective-C metadata parsers threw RangeError for a truncated or malformed record, so their catch sites treated any RangeError as a partial decode: a call stack overflow or a host string limit became an "unresolved" metadata reason, and the IL2CPP Mach-O path reported it as a malformed container. Those parsers and the CIL method body reader now throw ParseFailureError. hostRangeErrorKind is the one interpreter of a host RangeError (stack overflow, host capacity, raw out-of-bounds read), and parseFailureFromCause admits only a parse failure or a raw out-of-bounds read as evidence about the input. Fixup stream catch-alls rethrow host limits. The architecture guard counts the remaining direct instanceof RangeError checks. * fix(parsers): preserve Apple metadata failure ownership * test(architecture): shrink parser failure baseline * fix: preserve uncertainty for host range errors |
||
|
|
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 |
||
|
|
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 |
||
|
|
b138f52e12 |
refactor: prune internal seams and preserve configuration ownership (#10430)
* refactor: prune internal seams and preserve configuration ownership * fix(setup): keep YAML aliases and inherited registration settings on refresh - Reuse an unchanged YAML collection only while every alias in it still resolves after the edit; otherwise rebuild it so the alias becomes its value. A sibling anchor replaced or moved in the same refresh no longer leaves an unresolved alias in Hermes or Goose output. - Keep a connection selector whose existing value already chooses stdio (for example an inherited Hermes transport: stdio) instead of superseding it; remote selectors are still replaced. Explicit stdio selectors are therefore no longer rewritten (Kimi expectation updated). - When the whole Hermes registration is inherited through a merge, override it with that merge and write only the changed fields. * fix(setup): edit registration fields whose YAML key is an alias A key written as an alias to a string scalar (for example *field with field: &field env) was treated as a source-only key, so any change to its value was refused in Hermes and Goose. Resolve such keys to their string, keep the aliased spelling while its anchor survives the edit, and write the plain key when the same edit rebuilds the anchor. * test(process): bound cleanup-boundary waits and always release gates Both cancellation tests awaited a bare started promise and released their gates only on success, so a missed boundary waited for the outer deadline and could leave cleanup parked. Use awaitAcknowledgement and release and join the cleanup in finally. * fix(setup): repair only aliases an edit leaves unresolved Replace the pre-edit alias survival guess, which expanded aliases to sibling anchors that survive unchanged, with an exact repair: record what each alias in the replaced value resolves to, write the edit, then replace only aliases left without a preceding anchor by that value. - Keep an aliased key's source position, so its anchor stays ahead of later aliases. - Treat an aliased key as its string only when no other key in the map resolves to the same string; an ambiguous one stays guarded. - Override an inherited Hermes registration only when the requested entry keeps every inherited field, so an explicit replacement can drop remote selectors. * fix(setup): repair aliases whose binding an edit changes, keeping comments An alias whose own anchor was removed could resolve to an earlier anchor with the same name and silently change value. Record the node each alias resolved to and repair any alias that no longer resolves to that node. Carry the alias's comments and spacing onto the repaired value. * test(setup): split the Hermes anchor and merge refresh cases * fix(setup): refuse removing an overridden key its merge would restore The merge-retention check skipped keys the mapping also overrides, so dropping such a key (for example a remote url during an explicit stdio replacement) let the retained merge restore it. Check removal before skipping overridden keys, so the edit is refused with the existing message instead of producing a registration that cannot be applied. |
||
|
|
cdc4541ef7 |
refactor: remove redundant seams and preserve cleanup ownership (#10375)
* refactor: remove redundant seams and preserve cleanup ownership * fix: validate PE resource extents before budget checks |
||
|
|
02ebd3e02d | refactor: prune test-only seams and obsolete helpers (#10275) | ||
|
|
be6ec3f164 |
feat(il2cpp): retain v108 header and string evidence (#9925)
* feat(il2cpp): retain v108 header and string evidence * fix(il2cpp): preserve v108 BOMs and yield while scanning * fix(il2cpp): preserve uncertainty in v108 layout refusals --------- Co-authored-by: dhruvac29 <dhruvac29@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
8052f8daf0 |
fix(elf): preserve virtual relocation identity (#9990)
* fix(elf): keep compressed storage out of decoded metadata facts * fix(elf): preserve virtual relocation identity Keep linked initializer backing and relocation values in their owning virtual or ET_REL section coordinates. Replace the IL2CPP physical-copy materializer with compact virtual value facts while preserving file-backed capacity. Reuse initializer repairs and original regressions from ShuaixinHuang PRs repair retains independent alias values instead of blanket alias refusal. Co-authored-by: 帅鑫 Huang <1836656514@qq.com> * fix(elf): admit compressed string tables the profile does not read SHF_COMPRESSED string tables are rejected only when they name sections or symbols. An unreferenced string table is not decoded, so it no longer makes an otherwise analyzable ELF unsupported. * fix(il2cpp): admit virtual pointer workspace before retention * fix(elf): reject null relocation target sections * fix(il2cpp): avoid decoding unrelated Mach-O words * fix(il2cpp): preserve uncertainty in candidate scans * fix(il2cpp): bound uncertain array candidates * fix(il2cpp): preserve unknown registration candidates * fix(il2cpp): classify type kinds before bound data * fix(il2cpp): bind candidate counts to matching names --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 帅鑫 Huang <1836656514@qq.com> |
||
|
|
3c736dfe11 |
fix(targets): reject ambiguous native image selections (#9933)
fix(targets): refuse ambiguous slice and file mappings |
||
|
|
8bc01b48b4 |
feat(native): list ELF and Mach-O initializer and finalizer functions (#9574)
* feat(native): list ELF and Mach-O initializer and finalizer functions inspect_native_initializers and inspect-native-initializers list the functions an ELF or Mach-O image runs before and after main: ELF DT_INIT, DT_FINI, preinit, init and fini arrays and .ctors/.dtors, and Mach-O __mod_init_func, __mod_term_func and __init_offsets, with slot addresses, resolved targets, symbols where available and relocation facts for relocatable objects. Nothing is executed. Slot, symbol, relocation and note budgets are shared across tables, sentinels are matched at the image width, and target-derived names are bounded and marked untrusted. * fix(native): keep ELF initializer slots unresolved when relocation coverage is partial A skipped, unreadable or over-budget section relocation table now keeps every slot it could reach unresolved instead of reading the stored word as raw or dropping a .ctors slot as a sentinel. Dynamic writes that only partly overlap a slot, or write it twice, leave it unresolved. Linked images no longer reapply retained non-SHF_ALLOC link-time records. The dynamic relocation walk now pauses at the shared reader's step boundaries and observes cancellation there, resolved targets need only their first byte mapped, and unreadable symbol names make the report incomplete. * fix(native): stop reporting unchecked Mach-O initializer words as resolved Object files now apply their own section relocations: an UNSIGNED entry against a defined symbol gives symbol_addend, one against an undefined symbol gives unresolved_import, and any other entry leaves the slot unresolved. Linked images without a fixup decoder, such as 32-bit ones, keep pointer slots unresolved when an LC_DYLD_INFO bind stream or LC_DYSYMTAB external relocations could replace the stored word. LC_DYLD_INFO rebases now report dyld_info_rebase instead of chained_fixup, and unreadable symbol names make the report incomplete. Section headers keep their declared reloff and nreloc for this. * docs(native): move initializer guide under docs/guides/native The documentation guide assigns analyst workflows to docs/guides/<domain>/. Move the guide there, place its navigation and directory entries in the Native binaries group, and update links from the docs index, CLI guide, spec and authored skill. The public /native-initializers route is unchanged. The guide and spec also describe per-slot relocation coverage, retained link-time records, Mach-O object relocations, undecoded bind streams, the dyld_info_rebase resolution and unreadable names. * fix(native): keep IFUNC and partly relocated ELF initializer slots unresolved An absolute relocation against an STT_GNU_IFUNC symbol no longer reports the resolver address as the target. Section relocation records now use their real write width, so a record that writes only part of a slot, starts inside it or repeats it leaves the slot unresolved instead of reading a raw zero or dropping a .ctors slot as a sentinel. On 32-bit ARM the Thumb bit is cleared when locating a target's section and file offset, while value_va keeps the stored callable value. * fix(native): locate Thumb Mach-O initializer targets and reject arm64_32 with a 64-bit header On CPU_TYPE_ARM the Thumb bit is cleared when locating and naming a target, since nlist values do not carry it. An arm64_32 image that declares a 64-bit header is rejected as malformed rather than read with 8-byte slots. The guide and spec describe IFUNC relocations, partly relocated section slots, Thumb targets and this rejection. * fix(native): index initializer address lookups and keep ambiguous mappings unknown ELF and Mach-O initializer lookups now build the shared file mapping index once per image, so each slot and target lookup is logarithmic in the number of load segments rather than a scan of every mapping. An address that load segments map ambiguously no longer falls back to a section header offset. Its file offset is reported as unknown and the report is incomplete; only genuinely unmapped spans use the section fallback. * fix(native): report Mach-O bind names over the name budget A bound import name longer than the 1024-byte name budget was dropped without a trace, although it is the only identity of an unresolved initializer target. It now counts toward the over-long name limitation and makes the report incomplete. * test(native): count mapping lookups instead of timing the load index regression The load-mapping regression asserted a wall-clock bound, which is sensitive to machine load. It now spies on the shared mapping module and requires the same number of mapping scans and index builds for 8 and 64 slots, so a per-slot scan of every load segment fails deterministically on a small fixture. * fix(native): yield while decoding legacy rebase runs * fix(native): preserve initializer mapping and coverage * fix(native): index legacy fixup spans * fix(native): preserve relocation uncertainty and bound bind lookup work * fix(native): validate ELF slot mappings and yield section relocation scans --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
85be0f70a6 |
fix(artifacts): guide retries for symlinked files (#8725)
* fix(go): suggest resolved path for rejected symlinks * test(go): cover unresolved symlink recovery paths * fix(go): omit schema recovery for resolved symlinks * fix(artifacts): share resolved-path recovery across inspectors * fix(sqlite): retain resolved database path through snapshot reads * fix(captures): retain symlink retry guidance * fix(artifacts): preserve retry hints through redaction and selected reads --------- Co-authored-by: dhruvac29 <dhruvac29@users.noreply.github.com> |
||
|
|
e18594b247 |
refactor(composition): unify capability bindings and cleanup ownership (#8441)
Bind typed service creation, observed availability and retryable cleanup in one composition owner. Reuse selected CLI/MCP factories and canonical contract groups without copying provider operation inventories. Closes #8429. Refs #740. Validated paired real application workflows, actual local Codex CLI Terra/high use, complete Evidence and Unknown checkpoint parity, compiler-backed import boundaries, SDK schemas and final real mixed routing. Automated review findings were fixed at their producing owners. Existing exact-base CodeQL alerts are documented on the PR under the owner-authorized unrelated-check exception; no global alerts or security rules were changed. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) |
||
|
|
ef9ab91e42 | fix(il2cpp): validate retained declaring type relationships (#7946) | ||
|
|
183e2e2d1e | fix(il2cpp): validate structural record extents (#7861) | ||
|
|
570abe95f2 |
feat(android): link native declarations to static JNI candidates (#7472)
Link original DEX native declarations to per-ABI function exports and relocated static JNI table candidates through shared CLI/MCP workflows. Preserve global attribution ambiguity, exact provenance, partial coverage and retained Evidence; default MCP delivery to bounded summaries with filtered/batch pages. Use one immutable ELF relocation decoder with streaming IL2CPP materialization, cooperative bounded export/version parsing and bounded JNI state. Reuse validated session inventories without loading target libraries or executing JNI code. Validation: relevant type/lint/build and parser/domain/public CLI/MCP regressions; genuine four-ABI NDK fixtures and independent library/slot oracles; actual JDK/JADX Conscrypt workflows with retained-source removal. Full measurements and limitations are recorded in docs/verification/android-jni-bindings-2026-10-27.md. Closes #6403. |
||
|
|
c7afedc3d2 | refactor(macho): consolidate universal image selection | ||
|
|
44310bba32 | fix(il2cpp): validate selected FAT slice identity | ||
|
|
dd2cbbf1a2 | fix(il2cpp): require FAT container identity | ||
|
|
a7f50e3386 |
refactor: consolidate ELF and CLR record interpretation
Share ELF note headers across note inspection, Flutter build IDs, Node SEA, and recorded-crash source binding. Decode REL/RELA records once for MIPS shared-load analysis and IL2CPP linking, removing superseded scalar helpers. Share the CLR header prefix between desktop detection and managed PE parsing while preserving their distinct read bounds and admission policies. Cover those differences and ignored R_NONE fields with production-boundary tests. Validation: 493 focused tests passed, two existing skips; static checks and test discovery passed. Public managed/desktop CLI and ELF notes CLI/MCP workflows exercised; no real external analysis providers were run. |
||
|
|
6336fe5bb5 |
refactor: consolidate binary analysis admission and format ownership
Reuse the existing provider input admission helper across twelve services, preserving cancellation, schema errors, path policies, and Evidence handling. Share ELF dynamic records across Dart, MIPS, and IL2CPP readers, and reuse Mach-O segment and section records for Node SEA location. Require canonical DOS ownership before GPU PE section discovery so relocation bytes cannot masquerade as a PE pointer. Cover valid short DOS headers and the malformed case through both inventory and the public CLI. |
||
|
|
b3818bbba2 | refactor(il2cpp): share generic container byte decoding | ||
|
|
fdf5a33fe2 | refactor(tests): keep fixture adapters outside runtime | ||
|
|
149b43ee61 |
fix(il2cpp): link arm64 builds whose registrations were inlined (#6989)
* fix(il2cpp): accept arm64 module arrays loaded through adrp/add pairs A Unity 2022.3 macOS Master (LTO) arm64 build keeps no static CodeRegistration, so the module-array fallback that only decoded x86-64 RIP-relative references reported code-registration-not-found. The registration owner now also decodes aligned adrp + add pairs in executable ranges and keeps the same exact-module-set and single-reference rules. A minimal Mach-O fixture failed on the previous reader (47 passed / 1 failed) and passes here with four fail-closed variants (48/48 binary tests). * fix(il2cpp): name the matched instruction form in inferred module-array limits The inferred-array limitation always described RIP-relative LEA/MOV, which is wrong for arm64 results. The provider now names the adrp/add pair on arm64, and the tool contract and docs cover both forms and state that a located array alone does not finish linking a Master build. The new arm64 provider case failed before the wording change (1 passed / 1 failed) and both cases pass now. * fix(il2cpp): accept type tables loaded without a static MetadataRegistration A Unity 2022.3.62f3 macOS Master build inlines MetadataRegistration as well as CodeRegistration, so linking stopped at metadata-registration-not-found after the module array was found. Registration now infers the only field linking reads, the Il2CppType table, from the one run of type-shaped pointers that covers every referenced type index and whose start is loaded by the existing RIP-relative or adrp/add forms; types_field is null and the Evidence is inferred. The new arm64 and x86-64 fixtures failed on the previous reader (52 passed / 2 failed). Four run-selection variants (interior reference, run extended before the loaded address, two loaded runs, run shorter than the referenced indices) keep metadata-registration-not-found; instruction decoding and record-shape checks are not covered by these fixtures. * test(il2cpp): pin adrp page deltas, register pairing and type-record shape Every adrp fixture targeted its own 4 KiB page, so dropping the page delta or its sign extension, the add register check, the type-kind bound or the type-definition bound left all binary tests passing. Fixtures now reach a later and an earlier page, pair an add with a different destination or source register, break the type run with an out-of-range kind or type-definition index, and bound type-table candidates when the metadata references few type indices. Each of those five source mutations now fails 1 to 3 of 85 binary and provider tests. * refactor(il2cpp): share Il2CppType kind decoding and document type-table bounds The type-table fallback decoded the Il2CppType kind and class/value-type kinds separately from the type namer; both now use the Types owner. Zero and unaligned words are rejected before mapping lookup (Master sample metadata-registration search 92 to 68 ms). Docs and the limitation state that types_count is an upper bound, that a run spanning mappings or a small referenced type range can fail, and credit Cpp2IL StrippedCodeRegSupport and the data-side MetadataRegistration searches of Il2CppDumper and Cpp2IL. Master sample output is unchanged (11,031 code addresses, 37,025 type rows). * fix(il2cpp): refuse generic instances when the type table was inferred An inferred type table has no static MetadataRegistration, so the genericMethodTable it would anchor cannot be located. Report generic-methods-unsupported instead of reading from a null field. * fix(il2cpp): fail closed when an inferred type table is not unique Adversarial review found that the type-table fallback could pick another type-shaped pointer table when the real one was unloaded or excluded, could replace a static MetadataRegistration whose counts matched, and accepted a run cut short by a mapping end. Require exactly one long-enough run in the image, ending inside its mapping and loaded by code; skip the fallback when a record's two counts matched; accept only assigned Il2CppTypeEnum kinds; and look records up through the indexed file mapping so many mappings cannot multiply the scan. Docs and limitations now describe the run length as at least every referenced type index rather than an upper bound. * fix(il2cpp): keep the type-table fallback cheap and its refusals exact Review follow-ups: check that an address can lie in a mapping before the throwing indexed lookup, so words pointing into gaps or zero-fill no longer build an exception each (64 MiB: 74 s to under 2 s); treat a run starting at its mapping start like one reaching its end; stop at the second long-enough run instead of a 64-candidate capacity error; ignore ADRP/ADD pairs on register 31; and say whether a counted MetadataRegistration was unusable or no code-loaded run was found. Docs no longer generalize from one build or state tool history they do not source. * fix(il2cpp): judge type-table slots by their loaded value The run scan read stored words, so a dyld-bound slot's placeholder could decide whether a run qualified. Confirm each slot through readSlot and give a run bounded by a bound or unresolved slot an unknown extent, so the placeholder no longer changes the choice. * docs(il2cpp): keep the failure-reason table layout Shorten the two changed meanings so the table keeps its column widths and the diff shows only those rows. * docs(il2cpp): keep the reason table at its formatted width * fix(il2cpp): read type-table record fields through the loader too The previous change confirmed table slots through readSlot but still read each record's kind and definition index from stored bytes. Read them with readUInt32 and readSlot, and treat a record field the loader binds or leaves unresolved like an unresolved slot: the run it bounds has an unknown extent. * perf(il2cpp): share image mappings across loader-aware reads --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
3ce311757d |
feat(il2cpp): link generic method instances behind --generic-instances (#5785)
* feat(il2cpp): read generic containers on demand and render method spec names Generic container indices and records are demand readers on the same metadata snapshot, so links that do not ask for generic instances allocate nothing. Type rendering keeps one graph walk with its workspace, depth and cycle guards; the C#-like names and the Il2CppDumper GetMethodSpecName names are two styles over it. * feat(il2cpp): link generic method instances with admitted rows and kept issues generic_instances links every genericMethodTable row through methodSpecs, genericInsts and genericMethodPointers, choosing the one CodeRegistration layout whose counts bound every row. The table is reserved against the report budget before any row is resolved; rows and issues are admitted before retention, and a contradicting row stays unknown with an address-backed issue instead of failing the link. Views page the rows by definition, state, address and name, unrequested and historical collections stay unknown, and Ghidra seeds fold instances after the definitions. * feat(il2cpp): accept --generic-instances on the CLI and describe it in tool contracts * docs(il2cpp): describe generic method instances and their limits * fix(il2cpp): keep issued generic rows unknown and name their row A method spec that contradicted the metadata still reported its pointer slot as code, while the schema and provider limitation promised unknown. Such rows now keep no address, every issue carries its genericMethodTable row, the domain validator requires unknown exactly on issued rows, and shared specs name one other row instead of all of them. The row-size lower bound moves to the metadata admission owner, the hex helper is shared, and budget wording says checked rather than reserved. * test(il2cpp): reject ambiguous generic layouts and pin budget, yield and limit paths * fix(il2cpp): keep unmapped generic slots per row and reject undeclared arguments Layout selection no longer requires every genericMethodPointers slot to be mapped; each row reads its own slot, so one unmapped slot leaves only that row unknown with an issue. Method specs whose class or method argument count differs from the owner's declared generic container are issued and unnamed. Fixtures now declare the containers their generic rows fill. * fix(il2cpp): page generic method issues instead of retaining them in summaries Summaries keep generic_methods without its issues and count them in counts.generic_method_issues; the generic_method_issues collection pages them by rows, indices and fields, as code_gen_modules already does. Docs also name the method_indices filter the request schema accepts. * fix(il2cpp): read split generic arguments per slot and method containers on demand Generic argument arrays may span adjacent loader ranges: admit them with hasPointerArrayCoverage and read each slot through readPointer, instead of requiring the whole array in one mapping. Method generic container indices are read on demand from the method record, like type containers, so no link path allocates a per-method column. An owner whose container index is out of range now leaves the method spec unnamed with an issue instead of naming it unchecked. * fix(il2cpp): report generic entries past the address space at their row A damaged methodSpecs or genericMethodPointers pointer could make a spec or slot address exceed 64 bits. The issue kept that address, which the address schema rejects, so inspection failed instead of leaving the row unknown. Check the entry range first and attach the issue to the genericMethodTable row (or its slot field). * chore(il2cpp): remove unrelated formatting changes * fix: restore adb float pattern and mobile fixture from main The merge commit's lint-staged run rewrote these two main files: oxlint --fix dropped the escape in [+\-], which is invalid under the RegExp v flag. * fix(il2cpp): preserve unreadable generic method identities * docs(il2cpp): record generic-instance workflow verification * docs(il2cpp): qualify final integration checks --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
87745af52a |
fix(il2cpp): consume resolved ELF program declarations
Retain relevant program facts in the shared native directory and consume them for mappings and relocations. Remove redundant table coordinates and presence flags. This preserves extended program counts so PT_DYNAMIC beyond the raw sentinel remains visible, while load and relocation admission keep their distinct policies. |
||
|
|
4610843efd |
fix(filesystem): preserve failure provenance across cleanup owners
Carry descriptor outcomes, cancellation, retention and physical origin as named facts so wrappers cannot drop ownership context. Replace raw primary failure unwrapping with provenance facts across artifact consumers, and use Result for Kuna span reads including undefined rejections. Exercise actual descriptors, rollback, cancellation and cleanup retry; update brittle snapshot and completion fixtures to use their producing boundaries. |
||
|
|
231e458246 |
fix(native): preserve parsed section and architecture facts
Classify lipo parse failures once for native and artifact consumers, retain valid read-only ELF ranges independently of optional section names, and map IL2CPP reader architecture through the existing CPU identity owner before Mach-O parsing. Regression-first checks reproduced malformed lipo output, lost unnamed-section compiler paths, and the amd64/x86_64 adapter mismatch. Focused parser, artifact, Rust CLI/MCP, Go, and IL2CPP controls passed; authored fixtures do not establish real-provider behavior. Fixes #5982 Fixes #3397 |
||
|
|
52ca222bd0 |
fix(il2cpp): preserve loader ownership and ABI field boundaries
Resolve pointer and scalar facts through their shared loader-aware owners before registration search or type rendering. Preserve unresolved names and attributes, read count fields at their declared width, and admit declared zero-fill registration tails without accepting unmapped bytes. Cover relocation overlap and adjacency, loader-bound fields, ABI padding, nullable names, and CLI/MCP behavior; document format and verification limits. Fixes #6881 Fixes #6873 Fixes #6871 |
||
|
|
8b3902d377 |
fix(native): own complete metadata mappings and ambiguity
Resolve Go pointer descriptors and strings across complete, consistent file-backed spans, including PE headers and adjacent ELF load ranges. Reuse the canonical image-mapping selection for native exports. Preserve existing gaps, alias, zero-fill and capacity refusals. Forward parsed zero-fill ownership through IL2CPP relocation tables, destinations and mapped-span checks. Distinguish missing spans from ambiguous ownership in the shared mapping failure: unresolved relocation targets may remain unknown, while ambiguous raw registration bytes cannot be reused as a resolved count. Validation: parser, provider, service, native-export, IL2CPP and public CLI/MCP regressions cover PE32/PE32+ headers, split ELF descriptors/contents, relocation count conflicts, ordinary unresolved targets and unchanged inputs. Authored carriers establish static parsing, not Windows loading or actual legacy Go linker emission. Fixes #6831 Fixes #6830 |
||
|
|
a32d731ed7 | fix(providers): share selected-file error classification | ||
|
|
4c5fae5179 |
fix(il2cpp): decode valid shared-suffix string offsets
Preserve bounds, termination and UTF-8 checks; verify CLI and stdio MCP preserve names and selected artifact identity. Fixes #6808 |
||
|
|
99d2d7ad22 |
fix(parsers): retain independent facts and boundary identity
Share bounded ELF section-name decoding across native and note readers; retain read-only ranges and coverage reasons when names are unknown. Preserve ELF symbol-version bytes, dyld-bound method uncertainty, partial gRPC-Web trailers, and per-parent model identity checks. Compare GPU signatures as bytes and require a PTX module header. Share selected-path errno classification across EVM and BEAM. Validation: 397 shared-parser tests passed (one existing skip), 5 MCP schema tests passed, 14 EVM error-mapping tests passed, and 23 protobuf CLI/MCP matrix cases passed across focused runs. Build, typecheck/lint, docs, formatting, and 2134-file discovery passed. Full EVM provider workflow remains locally unverified on Darwin arm64; format controls are synthetic. Fixes #6738 Fixes #6737 Fixes #6745 Fixes #6740 Fixes #6749 Fixes #6747 Fixes #6739 |
||
|
|
5f702dd6cc |
fix(parsers): preserve format boundaries and query occurrence identity
Normalize parsed facts at their owning boundaries across PE exports and certificates, ELF section names, GPU bundles, IL2CPP generic types, dyld slice selection, source maps, environment replay, and JavaScript mapped arguments. Preserve partial facts and explicit unsupported cases; clarify the corresponding documentation. Validation: 831 affected tests passed with one existing skip across 23 files; build, typecheck/lint, documentation, formatting, and 2133-file test discovery passed. Format controls are synthetic; real Unity, GPU, and ARM-device execution is unverified. Fixes #6709 Fixes #6688 Fixes #6719 Fixes #6718 Fixes #6704 Fixes #6703 Fixes #6692 Fixes #6723 Fixes #6687 Fixes #6726 Fixes #6696 Fixes #6691 Fixes #6727 |
||
|
|
2bcd7e6d13 |
refactor(artifacts): centralize completed file outcomes
Project completed values and cancellation from the descriptor owner once across artifact consumers. Preserve completed void outcomes and format-specific validation and cleanup policies. Keep later aborts from replacing captured APK and SQLite close failures, and retain the exact APK cancellation reason. Exercise real descriptors, public workflows and cleanup retries. |
||
|
|
8cd10d4727 |
fix(il2cpp): deduplicate aliased metadata registration
Fixes #6715 |
||
|
|
f40bd0c4fb |
fix(il2cpp): deduplicate aliased registration fields
Fixes #6715 |
||
|
|
bdf13a63c4 |
fix(il2cpp): track unresolved ELF relocation widths
Fixes #6701 |
||
|
|
d31e42699f |
fix(il2cpp): deduplicate consistent ELF registration aliases
Fixes #6715 |