Repository navigation
Conversation
Record what raw-binary loads produce today, so a later change to how the load is represented has to keep it: - every admission result and pairing message over a grid of architectures, entry spellings and file sizes; - the analysis profile digest for each raw family; - the snapshot target and query identity of a raw ARM load; - the complete raw-binary load image for the ARM fixture. The values were computed at d6f88be without changing production code.
The caller's raw load selection (format, architecture and entry_point) travelled as three loose optional fields through about ten layers: CLI flags, MCP open, direct analysis (five call sites), the session port and open options, and target resolution. Every new load input had to be threaded through each of them. The CLI and MCP boundaries now build one NativeLoadSelection, and target admission is its only reader. Admission now returns one RawBinaryLoad, carried on the raw target as rawLoad. It names the base address of file offset 0 and the entry separately. Before, the provider client, the load-image attestation, the analysis profile and the snapshot target each read the entry and assumed it was also the base. Admission still sets the base to the entry, so nothing a caller sees changes. No contract or behaviour change. The tests pinned in the previous commit pass unchanged: the admission and pairing result grids, the per-family profile digests, the raw snapshot target and query id, and the complete raw load image. Tests that build raw targets use the new rawLoadAtEntry fixture.
Record provisional decision D1 (morluto#4246) as code before implementing it, so maintainers can confirm or redirect the contract cheaply. - src/domain/rawArchitectureVariant.ts owns the variant vocabulary: armv6-m, armv7-m, armv7e-m, armv8-m.base and armv8-m.main, each an ARM M profile with Thumb-only code and an M-profile vector table. It also owns the closed sets that persisted entries use: isa_mode, role (the entry's function: entry or reset) and basis (how REA chose it: caller or vector-table). - GHIDRA_RAW_VARIANT_LANGUAGES maps them to ARM:LE:32:Cortex and, for v8-M, ARM:LE:32:v8-m, which has the v8-M encodings Cortex lacks. This follows the GNU architecture names in Ghidra 12.1.4's ARM.ldefs. Provider language ids stay out of the domain. - CLI and MCP gain architecture_variant, and with it base_address and vector_table_address; the open_binary description explains them. Narrow first: a separate base is accepted only with a variant, the one lane verified with it. The pairing check names the input to correct, so MCP error paths come from one owner, and rawBinaryVariantSelectionIssue owns the rules for the new inputs. Legacy pairing messages and paths are unchanged and pinned. - Raw target summaries gain optional base_address, architecture_variant and vector_table_address. The load-image union gains the versioned segments shape (version 1): one file-backed segment, entries with address, isa_mode, role and basis, and, when the basis is the vector table, the table address with the two words read from it. - docs/raw-binary.md describes the inputs and Evidence, and two levels of identity: coordinates from resolved values only, sessions and snapshots also from the provenance that results report. It keeps the decision record, which includes not applying Ghidra's processor-defined labels to variant loads. - Tests are generated from the tables: pairing per variant and family, the Ghidra binding per variant, and the docs table and the skill reference's variant names against the tables. The persisted variant names are pinned. Admission refuses the new inputs until the following commits implement them. The base_address input follows morluto#4927 by Jean Granié.
Raw admission now implements the D1 inputs: - architecture_variant must match the family. Its code runs in Thumb state, so an even entry is accepted where generic ARM needs 4-byte alignment. An odd entry is refused as a Thumb interworking address. The error diagnostics give the even code_address and suggest omitting entry_point, so the caller's value is never silently changed. An odd generic ARM entry keeps its earlier reason and gains a hint to use the M-profile inputs. - With a variant, base_address maps file offset 0. The entry must lie inside the mapped image, and the address width is measured from the base. - With a variant and a base but no entry_point, admission asks the resolver to read the first two words of the vector table. It reads them at vector_table_address, or at the base when that is omitted. Word 1 must be odd and point inside the image; the entry is that word with bit 0 cleared. Word 0, the initial stack pointer, is recorded as observed and not validated. Admission applies the same rawBinaryVariantSelectionIssue rules as the pairing check, so CLI and MCP refuse the same selections in the same words. RawBinaryLoad records the variant, the entry's instruction set, and whether the entry was the caller's or read from a vector table. It keeps canonical values only: caller spellings are not facts about the load, and a session reused across spellings must report the same load. The grid pin is recomputed at d6f88be without the spelling and is otherwise unchanged. isLegacyRawLoad decides legacy equivalence on resolved values. Target summaries report base_address, architecture_variant and vector_table_address only for loads that are not legacy-equivalent. The load_selection_rejected recovery now lists the new inputs.
rawLoadIdentity is the one identity function for raw loads. A legacy-equivalent load has no new identity, so its analysis profile, coordinate context, snapshot target and query ids stay exactly as before; the pinned digests prove it. Any other load gets raw_load (version 1), built from canonical resolved values: the base, the variant, the vector table that Reset was read from, and the entry's address, instruction set, role and basis. The role names the entry's function (entry or reset); the basis records how REA chose it (caller or vector-table). Every load fact that summaries and Evidence report is in it, provenance included, so a reused session never reports what the current request did not choose. Spellings are excluded, so another base spelling, or an explicit vector table at the default location, reuses the same session. Absent values are omitted, as in the summaries and Evidence. - The snapshot target gains optional raw_load, compared canonically. Older snapshots have none and keep matching legacy loads. - The Ghidra profile commits raw_load, base_address, the variant's language, the Thumb entry context, processor_labels not-applied-v1 and load_image_evidence independent-raw-segments-v1. - The function coordinate context covers resolved values only. Beside the language and entry it already covers, it gains base_address and the entry's decode context. Analyses that differ only in role, basis, vector table or a variant with the same decoder stay comparable: a caller-named entry and Reset at one address share a coordinate context while their sessions stay separate. - The persisted variant names are pinned in raw_load.
The Ghidra raw lane now reads the committed load instead of assuming that the base is the entry: - The decoder comes from the variant (ARM:LE:32:Cortex or v8-m); generic ARM keeps ARM:LE:32:v7. - BinaryLoader maps the file at the base. A variant load is imported with -loader-applyLabels false: ARMCortex.pspec names the vector table at ram:0x0-0x40 and marks every handler slot an entry, reserved slots included, which at base 0 would cover the image and the code after the table. Loads without a variant keep the language default. - ReaGhidraPrepareRaw receives the base, the entry and the committed entry context. It requires the entry inside the file-backed block and, for Thumb, TMode=1 at the entry, and fails closed otherwise. - The bridge descriptor carries entry_context_register. The bridge accepts only the registers GHIDRA_RAW_ENTRY_CONTEXT can commit, and a launcher test keeps the two equal. It reports that register in load-image observations, so it no longer needs to match a language string to know about TMode. - Load-image attestation keeps the raw-binary image unchanged for legacy-equivalent loads; the pinned digest proves it. Other loads get the segments image (version 1): one file-backed segment at the base, the entry with its isa_mode, role and basis, the vector table address and both words read from it when Reset was derived, an entry_context.TMode check, and a check that the committed entry is the only external entry. Spellings of the same load give the same image, so a reused session reports what the current request would. - Raw limitations are derived from the load. Legacy wording is kept, except the claim that Cortex-M is unsupported. The base and entry separation in the prepare script, the TMode check and the entry-context attestation follow morluto#4927. Co-authored-by: jgranie <78536786+jgranie@users.noreply.github.com>
The segments load image is the first persisted shape these inputs add, so this commit adds the historical-snapshot and schema checks with it: - A raw-binary snapshot written at d6f88be, before base_address, still parses. It matches the same load admitted today, and its load-image Evidence replays and equals what this version produces. An M-profile load of the same file does not match it. - The earlier raw-binary Evidence schema rejects a segments image, so readers that predate it refuse the new shape instead of misreading it. An unknown segments version is rejected as well. - The advertised inspect_native_load_image output accepts both the saved and the segments images. The advertised open_binary input accepts calls from before base_address beside the new inputs, and rejects variants outside the table.
Add npm run verify:ghidra:cortex-m, adapted from the morluto#4927 verifier and its Cortex-M0 fixture. It drives the compiled CLI and stdio MCP server with source-owned images: - the Cortex-M0 (armv6-m) image at bases 0x0 and 0x08000000, and after a 256-byte boot2-style header opened with vector_table_address; - a Thumb-2 image (movw, movt, ldr.w, it, cbz) opened as armv7-m at 0x0 and as armv7e-m at 0x08000000; - an armv8-m.base image with movw, movt, cbz and udiv; - an armv8-m.main image that sets MSPLIM, which only the v8-M decoder names. LLVM is the independent oracle. The lane assembles each fixture's annotated source for its triple, requires identical bytes, and requires Ghidra to decode the same mnemonics in Thumb state. Mnemonics are compared without width qualifiers (ldr.w) or the dot Ghidra puts before an IT condition (mov.eq). The Cortex-M0 fill after its last return is declared as data, so neither decoder counts it as code. The lane also checks that Reset, read from the vector table, is the only entry Ghidra reports, the segments load image and its TMode check, decompilation, odd-entry refusal with code_address while the session is kept, CLI/MCP parity, unchanged legacy identity, refusal of a base without a variant, snapshot reuse across base spellings and refusal across variants, unchanged source bytes, and owned cleanup. Only named settings reach REA, which fixes the morluto#4927 review finding that an exported REA_GHIDRA_LANGUAGE_ID broke the verifier. Verified on Linux x86_64 (Debian 13) with Ghidra 12.1.4, OpenJDK 21.0.12 and LLVM 19.1.7; the oracle also runs with Apple LLVM 21. Not run on macOS or Windows. Co-authored-by: jgranie <78536786+jgranie@users.noreply.github.com>
ARMv8.1-M Mainline, as in the Cortex-M55 and Cortex-M85, gets its own architecture_variant row, decoded with ARM:LE:32:v8-m. Ghidra 12.1.4's ARM.ldefs lists armv8.1-m.main as a GNU name of that language, and its slaspec builds it with VERSION_8M. The next commit's real-Ghidra case checks that it decodes ARMv8.1-M low-overhead loops and MVE. Folding v8.1-M into armv8-m.main would use the same decoder but drop the profile from identity, and splitting it out later would change identity again. The decision record now says so. The docs table, the skill reference and the pinned persisted names follow the table. The refused-spelling test now uses armv8.1m.main, the LLVM triple's spelling, since armv8.1-m.main is accepted.
On real Ghidra 12.1.4, the ARM:LE:32:v8-m decoder names the ARMv8.1-M low-overhead-loop branches correctly but gets their flow wrong. In the Cortex-M55 image the next commit verifies: - WLS at 0x46 branched to 0x5a, 2 bytes short of its target 0x5c and inside the LE instruction; - LE at 0x58 branched unconditionally to 0x4e, 4 bytes past the loop start 0x4a, with no fall-through. So the code after the loop was never disassembled, and a function with such a loop is cut short. Results of armv8.1-m.main sessions now carry that limitation, and the raw-binary docs state it, instead of the claim that the decoder handles the low-overhead loops. MVE loads, stores and VCTP decode as LLVM decodes them.
The cortex-m lane gains a Cortex-M55 image opened as armv8.1-m.main at base 0x0: a WLS/LE low-overhead loop around the MVE instructions VLDRW, VCTP and VSTRW. LLVM assembles it for thumbv8.1m.main with -mcpu=cortex-m55 -mfloat-abi=hard, because clang 19 refuses MVE under the default soft-float ABI. The oracle takes the CPU and float ABI from the fixture. Ghidra must decode each instruction it reaches with LLVM's mnemonic in Thumb state, as in the other cases. A data type that gives only the element size (Ghidra vldrw.32) matches one with signedness (LLVM vldrw.u32); opposite signedness still fails. The lane now reports every disagreement in one run instead of stopping at the first. Ghidra 12.1.4 does not follow the loop's exits (see the previous commit), so this case requires the pop after the loop to stay undisassembled, records both loop branches' flow, and checks that the results report the limitation. Base 0 also checks that the v8-m decoder's vector table gets no processor labels. Verified on Linux x86_64 (Debian 13) with Ghidra 12.1.4, OpenJDK 21.0.12 and LLVM 19.1.7: all eight cases pass. The oracle also runs with Apple LLVM 21. Not run on macOS or Windows.
The variant table is no longer only for raw loads: the M-profile ELF lane uses the same vocabulary. Its internal names now follow the public input, architecture_variant, without an ARM M-profile prefix that would need renaming again once other architectures get variants: - src/domain/rawArchitectureVariant.ts becomes architectureVariant.ts, together with its test and the docs conformance test; - RawArchitectureVariant, RAW_ARCHITECTURE_VARIANTS, RAW_ARCHITECTURE_VARIANT_NAMES, rawArchitectureVariantSchema and rawArchitectureVariantRow drop the raw prefix; - GHIDRA_RAW_VARIANT_LANGUAGES becomes GHIDRA_VARIANT_LANGUAGES, and ghidraRawProcessorLabels becomes ghidraVariantProcessorLabels. Identifiers only. Saved values, schemas, lane ids and the processor_labels value are unchanged: the recorded catalog digests and MCP catalog are byte-identical before and after, the pinned profile and snapshot digests pass unchanged, and no snapshot fixture changes. Names that mean the raw load keep theirs: RawBinaryLoad, rawLoad, raw_load, and the vocabularies of its entries (RAW_ENTRY_ISA_MODES, RawEntryIsaMode, RAW_ENTRY_ROLES and RAW_ENTRY_BASES).
The low-overhead-loop limitation lived in the raw-binary limitations, but it describes Ghidra's ARM:LE:32:v8-m decoder for armv8.1-m.main whatever container holds the code. The M-profile ELF lane maps ELF builds to the same variants and must report the same text. GHIDRA_VARIANT_LIMITATIONS now sits beside GHIDRA_VARIANT_LANGUAGES and states the limitations of every variant, so adding a variant also decides them. Raw results read it; their text and order are unchanged.
A variant without base_address mapped the image at its entry, and the odd-entry suggestion led callers there: retrying with the even code_address and no base mapped the vector table at Reset, and the segments image still verified. architecture_variant now requires base_address, the address of file offset 0, and the odd-entry suggestion no longer offers a retry without a base. A code fragment that starts at its entry passes that address as its base. Loads without a variant are unchanged.
VTOR.TBLOFF holds address bits 31:7 wherever VTOR exists (ARMv6-M with VTOR, ARMv7-M, ARMv8-M), so a vector table is at least 128-byte aligned. Admission accepted any 4-byte-aligned table, so naming the Reset slot (0x10000104) instead of the table (0x10000100) read NMI as Reset and reported it with role reset. A named table and the default at the base now need 128-byte alignment. A Reset word that points into the 8 table bytes just read is refused too. Even, outside and inside Reset words stay load_selection_rejected, with the observed words as diagnostics: a raw dump has no format they can violate, and the usual cause is a wrong base, table or variant.
A variant load maps file offset 0 at base_address, so with the decoder and the entry's decode context the base fixes every coordinate. The coordinate context still held the entry address, so functions found from two entries of one image did not compare. Variant coordinate contexts now take the base from the admitted load and leave the entry out. Variant profiles commit raw_load without flat entry_point and base_address copies of it; entry_context stays as Ghidra's seeding commitment, which raw_load does not record. Legacy profiles keep their parameters and digests.
The segments load image named its shape with variant: "segments", beside architecture_variant, which names the decoder. It is now layout: "segments", as layout names data shapes elsewhere in REA. The shape is unreleased, so no saved Evidence uses the old key.
vector_table.initial_stack_pointer and reset_vector are words read from the table, not addresses: REA reports format words such as GPU code-object flags and metadata tokens as full-width hex, and the entry already holds Reset's canonical code address. The schema, admission and raw-binary guide now say so.
Ghidra names the function REA seeds at a raw entry entry, whatever the entry's role, as its loaders name a program entry. The load image reports the role; naming the function after it, as CMSIS Reset_Handler, would claim a symbol the image does not carry. The prepare script and the decision record now say so.
Raw admission refused a pairing with the rule's message but dropped the field it named, so callers had to read the input to correct from prose. Each raw admission refusal now names the input to blame, and BinaryTargetError projects it as details.field on the CLI and MCP; the Reset-word refusals and a file too short for a table at its base name none. Pairing refusals from the target resolver keep their field too. MCP refuses invalid pairings in the open_binary input schema before admission; that error reports path [] as it does on main and is left unchanged here.
The raw_load identity comment claimed Evidence parameters keep the caller's spellings of the load inputs. They do not: summaries, Evidence and snapshots report canonical addresses only, as legacy entry_point did before these inputs. The comment and the raw-binary guide now say so, and the decision record names the gap and the caller_input_path pattern that could close it additively.
raw_load leaves the two vector-table words out, yet results report them. They cannot go stale: sessions and snapshots also match the file digest, and with the base and the table address it fixes the bytes the words are read from. The identity comment and the raw-binary guide now say so.
The generic raw-language limitation listed 68020, ColdFire and other "processor variants" as unsupported, which read as future architecture_variant values. It now says those languages are not offered and that architecture_variant names only ARM M profiles. The variant table and the decision record also state the scope: the base requirement, Reset derivation and label policy hold for every row because every row is an M profile, and a variant of another family would first make them per-row properties.
open_binary said that architecture_variant requires base_address, and that entry_point may then be omitted, in its tool description and again in three field descriptions; the default compact input profile advertises all of them. Each rule now sits on the field it constrains, and the tool description points to the M-profile lane in one sentence. CLI flag help follows the same split. Measured from tools/list of a server built from this source, the trim saves 237 bytes of open_binary in each input-schema profile.
A segments load image restated that only the file is mapped, that processor labels are not applied and where Reset came from, beside the session limitations that every result, the load image included, already carries. The load image now states only what its verification covers and requires; the session limitations are the one owner of the load facts.
The Ghidra client recomputed the processor-label policy from the target's variant instead of reading the processor_labels value the analysis profile commits, so the launch and the profile each held their own copy of the rule. The client now reads the committed value, named once as GHIDRA_PROCESSOR_LABELS_NOT_APPLIED, and a behavior test checks that a variant profile reaches the launcher without labels.
Admission and the target resolver each knew that the vector table read is 8 bytes: the resolver passed a literal 8 and admission checked one. RawBinaryVectorTableRead now carries byteLength beside fileOffset, and admission derives its bounds, inside-table check and message from one constant.
The compatibility test required a snapshot saved before base_address to equal today's raw load image exactly, limitation text included, so any rewording of a limitation would fail it although no fact changed. It now compares every field except limitations.
Closed
2 tasks done
Contributor
[Medium impact] No blocking code issue remains in the reviewed changes. SummaryAdds separate load bases and Thumb entry support for ARM M-profile raw images. The latest change fixes comparisons between compatible loads that chose their entries differently.
Recorded acknowledgments:
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Admitted raw load] --> B[Full target identity]
B --> C[Sessions and snapshots]
B --> D[Address comparison key]
D --> E[File digest, format, architecture, base and variant]
E --> F[Provider decode-context check]
F --> G[Function comparison and call paths]
Reviews (36) · Last reviewed commit: "fix(domain): compare raw-load functions ..." · Reviewed by Greptile |
main's morluto#9817 condenses the open_binary description; keep its wording and add this branch's M-profile clause (architecture_variant and base_address read Reset from the vector table) to its raw-binary sentence.
…gh their shared owners Main's architecture guards require BinaryReader for numeric reads and VerifierFixture for verifier fixture roots.
closeEarly stops the command owner but keeps the root, so every successful run left its fixtures, snapshots and LLVM outputs behind while reporting cleanup complete. Release the workspace once process lineage is verified; a failed run still keeps it for diagnosis.
…oad fields CI's package build compares the committed advertised-schema summaries with the packaged catalog; regenerated with `node scripts/verify-advertised-schemas.mjs --update-summary`.
…nd table Main's command-table test (morluto#11777) pins the flag of each open_binary field a direct-analysis command takes; D1 adds --architecture-variant, --base-address and --vector-table-address.
Commands that open a target list open_binary's options; D1 adds --architecture-variant, --base-address and --vector-table-address. Recorded with REA_RECORD_CLI_PARITY=1 from the built CLI.
A load without the M-profile inputs keeps its analysis profile inputs, snapshot target and load image, but every analysis profile also commits to the REA release and packaged bridge scripts. A snapshot saved by an earlier release is therefore refused after an upgrade either way. Say so, and point to the Ghidra guide's producer rule.
The verifier compared the completed lineage's status and descendants directly, so an unavailable lineage failed as a bare equality without its reason. Use the shared assertVerifierCleanupComplete, which names the reason, as docs/development/testing.md requires.
…venance compare_functions and build_call_path required equal target identity, which for a non-legacy raw load includes the entry's address, role and basis and the vector table it was read from. Two loads of the same image at the same base, one with Reset read from the vector table and one with a caller-named entry, therefore stopped comparing, although their function coordinate contexts match and the raw-binary guide says they compare. targetIdentity now owns sameTargetCoordinates, which keeps a raw load's base and variant and leaves out how it chose its entry; a legacy load still places addresses by its entry. Both comparison workflows use it. Session, snapshot and Evidence subject matching keep the full identity.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
STM32 and other Cortex-M flash dumps could not be analysed. The raw lane mapped file offset 0 at the entry, pinned ARM to
ARM:LE:32:v7(ARM state) and refused odd Thumb entries, so the vector table was decoded as ARM instructions (#5744 reports 1,816 garbage procedures). With this PR:maps the dump at
0x08000000, reads Reset from the vector table, and seeds a Thumb entry in the variant's decoder.Refs #4246, #5744. Builds on #4927 by @jgranie: this PR reuses its base/entry separation,
TModecheck, entry-context attestation, Cortex-M0 fixture and verifier, in co-authored commits.Decision record: D1, raw ARM M-profile images (provisional)
architecture_variantnames the M profile, which a raw dump does not record.armv6-m,armv7-mandarmv7e-mdecode withARM:LE:32:Cortex;armv8-m.base,armv8-m.mainandarmv8.1-m.mainwithARM:LE:32:v8-m, in Thumb state.base_address, the address of file offset 0; without a variant,base_addressis refused (narrow first). Withoutentry_point, REA reads Reset from the 128-byte-aligned vector table and clears bit 0. Reset must be odd, inside the image and outside the table; the initial stack pointer is recorded, not validated. An explicit oddentry_pointis refused.segmentsload image and recordraw_load, bothversion: 1. Coordinate identity covers the decoder, base and entry decode context; session and snapshot identity also coverraw_load. No result keeps the caller's spellings.0x0would cover the vector table and the code after it.processor_variantas the name (feat(ghidra): support Cortex-M raw images with separate load base #4927): an alias and a deprecation period.cortex-mvalue (feat(ghidra): support Cortex-M raw images with separate load base #4927): not a lossless alias;ARM:LE:32:Cortexcannot decode v8-M encodings such asMSPLIM.segmentsandraw_loadare permanent once released, so changes ship asversion: 2; older readers refuse unknown values (checked here).Problem and expected behavior
raw-binarywitharmalways meantARM:LE:32:v7, base = entry, and 4-byte-aligned entries.REA_GHIDRA_LANGUAGE_IDis refused for raw targets.details.fieldon refusals.Change and scope
4de50d598,893a02391: refactor, no behaviour change. One admittedNativeLoadSelectionreplaces load inputs threaded through about ten layers; four consumers no longer assume that offset 0 maps at the entry.56f27b3de: the D1 contract, docs and table-driven tests.f7b449622,74b4a2cb4,e1271f91c: admission, identity and the Ghidra lane.5962d2a74,6565d11d4: compatibility and real-Ghidra checks.ea8ac340d,8bd006ea5,b45a7d4ef: ARMv8.1-M and its limitation.8d9e15a2a,63f25520f: names afterarchitecture_variant; one shared limitation text.56a058768–d7622e821: review round (a base with every variant, vector-table checks,details.field).36e090818,d708eb457,beaa182df,c9435592a,13906c5f3,a1c564e26,874513032,93cde07ff,54d4d3373:mainmerges, adapted to fix(ghidra)!: distinguish unlisted instruction addresses #7823, feat(artifacts): inventory and extract U-Boot FIT images #7771, fix: report provider admission failures as typed codes #8066, feat(artifacts): inventory and extract ESP flash layouts #8228, feat(investigation)!: retain records across engine cleanup #8361, refactor(composition): unify capability bindings and cleanup ownership #8441, fix(snapshot): report binding mismatches #8432, fix(ghidra): retain relocation symbol observations #8531 and fix(native): find procedures by the secondary names exact lookup accepts #8520, and tomain's move of the lane docs todocs/testing-lanes.md.1b55c3a1d,a7451a04f: review threads; the Cortex-M lane owns its LLVM and CLI commands.bd985a4e0,4731755d4: docs; a caller that needs its spelling keeps its own request.46a8db4ee,f0c95ab28,3760d363b,9d7ab2ca7: refusal tests check facts rather than sentences; digest repins formain's call-coverage revision; the regenerated skill bundle; a diagnostics length limit.7b4d25e57moved the decision record intodocs/adr.cf445aa83, which mergesmain39ccb1d3b, removes that file again, becausemain(docs: remove tracked planning and architecture records #12856) keeps decision records in PR discussion. The record above is the authoritative copy, and the raw-binary guide states the caller-spelling gap directly.cf445aa83and3d8e5c395mergemain39ccb1d3banddff9b479e, adapted to Ghidra 12.2 with JDK 25 (feat(ghidra)!: verify the bridge on Ghidra 12.2 #12081), target-identity snapshots (refactor(domain): compare snapshot targets through one target identity key #11341, feat(snapshots)!: persist the target identity as the snapshot target #11551:raw_loadis an optional member of theentry-pointselection, so legacy loads keep their identity), CLI flags from contracts (refactor(cli): register every command in an REA-owned command table #11680: the three flags areopen_binaryfields onmain's native target), the target-format vocabulary (refactor(targets): share the resolved target format vocabulary #12165), profile values without-vN(refactor(providers)!: key Ghidra and Hopper analysis profiles on the producer identity instead of hand-bumped markers #11320; theload_image_evidenceandentry_seedbumps are gone and literal digest pins became computed comparisons), and new architecture guards (BinaryReadervector reads,VerifierFixture).dd59ab04c,583ecb73d,0edf3529f,207631c1a,35fbcb899: the lane recorded on Ghidra 12.2; vector reads and the Cortex-M workspace through their shared owners;raw-binarynamed as the format of vector-table read failures; the Cortex-M workspace removed after a verified run (review); and the regeneratedopen_binaryadvertised-schema summary that CI's package build compares.3d8e5c395,f6415fe0d,c8a68a4d4:mainmergedff9b479e; the CLI command table and help goldens record the three newopen_binaryflags.0a66d7c00:mainmerged35e14270.mainchanged the Ghidra bridge (perf(ghidra): eliminate non-ASCII search flood, compact bridge inventories, and stream JSON responses #13305), and this PR's bridge additions merge with it without change. InghidraLauncher.test.ts, both sides added adescribeblock at the same place: this PR's entry-context descriptor tests andmain's checkpoint-restore tests. Both are kept.14bce8ea4: the raw-binary guide no longer promises that a load without these inputs keeps replaying its snapshots. Every analysis profile commits to the REA release and the packaged bridge scripts, so an older release's snapshot is refused after an upgrade either way (review).b660ef4af:mainmerge36997555d.mainmoved the native-target CLI options intosrc/cli/nativeTargetOption.ts(perf(cli): decouple lazy CLI startup from AnalysisView, session contracts, and MCP registration #13435) andOPEN_BINARY_TOOL_CONTRACTintoopenBinaryToolContract.ts(perf(cli/mcp): decouple analysis view contracts and defer tshark PATH probes #13316). This PR's three flags, their help text and its longeropen_binarydescription now live in those files, andoptions.tsandsessionToolContracts.tsequalmain's.main's test(ghidra): consolidate raw profile and packaged producer proof #13379 merged two raw-profile digest tests into one with a computed producer; that test now builds its target with this PR'srawLoadshape, and this PR's copies of the two older tests are gone. No digest is pinned.77d14bd2a: the Cortex-M verifier checks cleanup through the sharedassertVerifierCleanupComplete, which names why a lineage could not be verified (review).5ecb56dd3:mainmerged7ccd3098.main's refactor(ghidra): extract GhidraSessionErrorProjection from GhidraProviderClient #13722 moved Ghidra session-error projection out ofGhidraProviderClient.ts, including itsRuntimeExhaustionimport; the merge keeps that removal and this PR's widerGhidraRawBinaryLanguageimport. This PR's changes to the client sit increateGhidraProviderClient, which refactor(ghidra): extract GhidraSessionErrorProjection from GhidraProviderClient #13722 did not move.db9bc1d28:mainmerge686bb097f.main's refactor(application): extract BinaryTargetExecutableProbes from BinaryTargetResolver #13826 moved the executable probes out ofBinaryTargetResolver.ts. This PR'sloadSelectionpath stays inreadOpenedBinaryTarget, and its vector-table read usesmain'sreadHandleRange. The only conflict was one import line.07f639ccf:mainmerge5142124ca, clean. It bringsmain's refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks #13882, which fixes thecliStartupImportsfailure ([Bug] analyze-javascript-application loads AnalysisViewService at CLI startup since #13861 #13940) that item 21's CI hit.4f2952701:compare_functionsandbuild_call_pathcompare two non-legacy raw loads by their coordinates (file, format, architecture, base and variant), not by how each chose its entry. A load whose entry came from its vector table and one whose caller named the entry, at the same base and variant, compare as the raw-binary guide says.targetIdentity.tsowns the rule assameTargetCoordinates; session, snapshot and Evidence subject matching keep the full identity (review).Not included: a base without a variant;
vector_table_addresswith an explicitentry_point(refused); SRAM, peripheral or system blocks; vectors other than Reset; device memory maps; floating-point ABI or TrustZone modelling; caller spellings; Windows. The legacy pairing check still runs twice (MCP schema and admission, worded differently); unifying it changes legacy CLI error text, so it needs its own PR.Contract and boundary impact
src/domain/architectureVariant.ts,src/ghidra/GhidraRawBinaryLanguage.ts,src/domain/rawBinary.ts, the Ghidra profile, the session limitations andnativeSegmentsLoadImageSchema. Removed: the threaded load fields and the consumer-side base derivations.architecture_variant,base_addressandvector_table_address; optional summary fields; an updatedopen_binarydescription; asegmentsload image. Changes for loads without a variant: the raw session limitation no longer lists "Thumb-only, Cortex-M" as unsupported; an odd generic-ARM entry's refusal gainsdetails.diagnostics; theload_selection_rejectedremediation lists the new inputs; raw refusals gaindetails.field. The defaulttools/listgrows by 7,912 bytes against the refactor head893a02391, measured ond7622e821; tokens were not measured.entry_context_register(TModeonly), and variant imports add-loader-applyLabels false; all ship with the launcher.segmentsandraw_loadfor variant loads only. Savedraw-binaryload images stay readable, and other loads keep main's target identity and profile inputs. As with any REA upgrade, the producer commitment still refuses snapshots that an earlier release saved. A snapshot saved before fix(ghidra)!: distinguish unlisted instruction addresses #7823, such as thed6f88becdfixture, replays on neither main nor this branch; its profile differs only byinstruction_status.rawLoadinstead ofentryPointin the unschematiseddetails.diagnostics.completed_target.docs/public/product-catalog.json), package, or installation impact: one development script,verify:ghidra:cortex-m.Expected effects:
Evidence and regression coverage
4de50d598first pins legacy results fromd6f88becd(2,200 admission results, pairing, profile digests, snapshot target, load image); only the admission grid is recomputed later, and the digests holdmain's own values, now those ofd3ab0faf5. New tests cover each variant's admission, refusals and identity, labels, snapshots,segmentsattestation, launcher and bridge arguments, schemas and docs tables.d6f88becd(GhidraProviderClient.ts:446-450,ReaGhidraPrepareRaw.java:25-47,GhidraRawBinaryLanguage.ts:47-52,rawBinary.ts:113-120).d7622e821:--entry-point 0x08000041with--architecture-variant armv7-m --base-address 0x08000000is refused before any provider starts: "Cannot open artifact: raw-binary armv7-m entry_point 0x8000041 is a Thumb interworking address with bit 0 set; its code address is 0x8000040." The error hasdetails.fieldentry_pointand thecode_addressindetails.diagnostics. A variant without a base is refused withdetails.fieldbase_address.wlsat0x46targets0x5a(LLVM:0x5c) andleat0x58jumps unconditionally to0x4e(LLVM: back to0x4a, else fall through). So thepopat0x5cis never disassembled (not-in-listingsince fix(ghidra)!: distinguish unlisted instruction addresses #7823); the lane requires this and checks that results carry the limitation.For evidence-bearing changes:
Validation performed
4f2952701(item 23). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed.npm run test:focused --over 743 files gave 12,648 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases.verify:ghidra:bridge-sourcespassed, and so didverify:ghidra:cortex-mandverify:ghidra:raw, both with"mocked": false. On macOS arm64,functionComparison.test.ts,callPath.test.tsand the comparison and call-path MCP boundary tests passed 153 tests; the two new cases fail with the previous identity check. CI on this head: 38 checks passed, 19 skipped, none failed.07f639ccf(item 22). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed.npm run test:focused --over 743 files gave 12,634 passed and 2 failed, both root-only Kuna cleanup-retry cases.verify:ghidra:bridge-sources,verify:ghidra:cortex-mandverify:ghidra:rawpassed, the last two with"mocked": false, andtests/boundary/cli/cliStartupImports.test.tspassed 10 of 10. CI on this head: 38 checks passed, 19 skipped, none failed.db9bc1d28(item 21). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed.npm run test:focused --over 743 files gave 12,634 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases; the list includescliParityGoldens,cliCommandRegistryandrawBinaryCli.verify:ghidra:bridge-sourcespassed, and so didverify:ghidra:cortex-mandverify:ghidra:raw, both with"mocked": false. CI on this head failed onlytests/boundary/cli/cliStartupImports.test.ts› "loads summary projection and bundle delivery only when requested", in shard 11 and Portable tests. That test fails onmainitself since refactor(application): migrate 7 standalone format services onto executeArtifactInspection #13861 ([Bug] analyze-javascript-application loads AnalysisViewService at CLI startup since #13861 #13940).5ecb56dd3(item 20). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed.npm run test:focused --over 743 files gave 12,634 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases.verify:ghidra:bridge-sourcespassed, and so didverify:ghidra:cortex-mandverify:ghidra:raw, both with"mocked": false. CI passed on this head: 38 checks passed, 19 skipped, none failed.77d14bd2a(item 19). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cachedanddocs:checkpassed, and so did the verifier-lineage test.verify:ghidra:cortex-mpassed with"mocked": falseand reported complete cleanup through the shared check. CI on this head: shard 3 and Portable tests each failed one case,tests/boundary/providers/ida/verifierRequirements.test.ts, with "Command deadline elapsed" (a 10-second child-process deadline). In the same container that test passes in about 2.2 s on this branch and onmain, three runs each.b660ef4af(item 18). Linux x64 container, Ghidra 12.2 with JDK 25, Node 24.22.1, run as root:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed, and no advertised-schema summary, CLI golden or command-table entry needed re-recording.npm run test:focused --over 743 files gave 12,649 passed, 121 skipped and 2 failed, both root-only Kuna cleanup-retry cases.verify:ghidra:bridge-sourcespassed, and so didverify:ghidra:cortex-mandverify:ghidra:raw, both with"mocked": false.14bce8ea4. It adds only the docs commit in item 17 to0a66d7c00, andnpm run check:fastanddocs:checkpassed on it.0a66d7c00mergesmaind35e14270; the only conflict is the test-file one in item 16. The entry-context register set and descriptor key are intact onmain's changed bridge.0a66d7c00:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed. No advertised-schema summary or CLI golden needed re-recording.npm run test:focused --over 753 files gave 12,923 passed, 121 skipped and 2 failed. Both failures are Kuna cleanup-retry cases, which fail only as root.verify:ghidra:bridge-sourcespassed, and so didverify:ghidra:cortex-mandverify:ghidra:raw, both with"mocked": false.c8a68a4d4.3d8e5c395mergesmaindff9b479ecleanly.main's CLI command-table test (feat(errors): carry related parameters and operations and derive CLI flags and commands #11777) and CLI help goldens now coveropen_binary's flags, which this PR extends, sof6415fe0dadds--architecture-variant,--base-addressand--vector-table-addressto the table, andc8a68a4d4re-records the three affected help goldens withREA_RECORD_CLI_PARITY=1from the built CLI.f6415fe0d:npm run build:cachedpassed, and after recording,cliParityGoldens,cliCommandRegistryandrawBinaryClipassed. On3d8e5c395:npm run check:fast,build:cached,docs:checkandnode scripts/verify-advertised-schemas.mjspassed;npm run test:focused --748 files: 12,796 passed, 120 skipped, 2 failed, both Kuna cleanup-retry cases that fail only as root because root ignores thechmodthey rely on. That list does not include the command-table test and goldens, which are not this PR's files. On35fbcb899: the same four checks passed, andnpm run verify:ghidra:cortex-mpassed,"mocked": false; that run left no workspace, and two runs before207631c1ahad.npm run test:runonc8a68a4d4as a non-root user (Ghidra 12.2, JDK 25): 54,542 passed, 326 skipped, 2 failed. Both failures read generated outputs that a baretest:rundoes not build (docs/public/product-catalog.jsonanddocs/verification/managed-conformance-manifest.json, bothENOENT);check:prgenerates them first, and the same two fail the same way on three unrelated heads.c11d6db57contains35fbcb899; its fullnpm run check:prpassed as a non-root user, all 55,198 tests, with integration's own command table and goldens.35fbcb899: Static checks, Build package (with the regenerated advertised-schema summary) and Source tests passed. Test shard 6 failed oncliCommandRegistry(fixed byf6415fe0d), and the other shards and Portable tests stopped after it. "Reverse tools quality" failed because its Stryker TypeScript checker rejectssrc/server/EvidenceMcpServerCore.ts(TS7022 and TS7024 onadapterandcatalog), whichmain'sfd40fd9abchanged and this PR does not touch;mainfixed it in7a2e8da49. CI on0edf3529f: all 33,032 tests passed; Build package failed only on the stale summary that35fbcb899records.0edf3529f(this session's fork run, same container):npm run check:fast,build:cached,docs:check,npm run test:focusedover 35 files (1,303 tests) andverify:ghidra:cortex-mpassed;verify:ghidra:raw,:doland:bridge-sourcespassed at4038a1cf4, whose source differs only by guard refactors.Local checks ran on macOS arm64 (Darwin 25.5.0) with Node 24.22.1 and npm 11.19.1.
a0717a65e, which mergesmain0beedcd71.8b7893665mergedmainfe677f6cf, where fix(mcp): report target after failed open #8613 rewordedopen_binary's failed-open sentences; the description keepsmain's wording and this PR's M-profile sentence. No Ghidra digest pin changed.npm run check:fast,format:check,docs:check,knipand 85 test files (this PR's,src/ghidra,src/contracts,toolSchemaValidityand the three named below; 2,123 passed, 11 skipped) passed. CI passed on this head.8b7893665:npm run verify:ghidra:cortex-m,:rawand:bridge-sourcespassed in a Linux container (Ghidra 12.1.4);cortex-mandrawreport"mocked": false, cleanup complete.mainchanged no Ghidra, bridge or verifier file between the two merges, so they did not run again ona0717a65e.8b7893665failed onmainfe677f6cf's own findings, and later shards were cancelled: a lint error inwebSourceLocationCli.test.ts, and one test each inanalysisViewMcp.test.ts,fridaCli.test.tsandprocessCapture.comparison.test.ts. The lint error and those three tests fail the same way on cleanfe677f6cf, and the tests pass on0beedcd71.8aec915c6, which mergesmain71f680d7c.open_binary's description keepsmain's failed-open sentence and this PR's M-profile sentence.main's reference, byte-search (fix(ghidra)!: search adjacent initialized memory blocks #8840) and data-type (fix(ghidra): expose bit-field base type identity #8602) revisions change every Ghidra profile digest. With those revisions reversed, the merged tree keeps every earlier pin. The legacy pins takemain's own digests at71f680d7c, computed onmain, which all five loads match; the variant digest is re-pinned; andrawLoadCompatibility.test.tssets aside the four revisions.npm run check:fast,format:check,docs:check,knipand the 30 test files this PR changes (1,055 passed, 8 skipped) passed.npm run verify:ghidra:cortex-mandverify:ghidra:bridge-sourcespassed in a Linux container (Ghidra 12.1.4),"mocked": false, cleanup complete. CI passed there.b250be13d, which mergesmainc3647ade1without conflicts:npm run check:fastpassed, and the 4 provider-client test files (244 tests) andtests/boundary/filesystem/binaryTarget.test.ts(95 passed, 1 skipped) passed. CI passed there.54d4d3373, which mergesmaind3ab0faf5.mainmoved the real-toolchain lanes section todocs/testing-lanes.md, so the Cortex-M lane paragraph moves there unchanged, anddocs/raw-binary.mdlinks to it.main's load-image observation (fix(ghidra): retain relocation symbol observations #8531) and procedure search (fix(native): find procedures by the secondary names exact lookup accepts #8520) revisions change every Ghidra profile digest. With this branch's own bridge and shared semantics, the merged tree keeps every earlier pin. The legacy pins takemain's own digests atd3ab0faf5, computed onmain, which all five loads match; the variant digest is re-pinned; andrawLoadCompatibility.test.tssets aside the two revisions besideinstruction_status.npm run check:fastanddocs:check— passed.format:checkfails only on 16 files that this PR does not change; they are byte-identical tomain, whose own CI fails the same way.npm run test:focused --with the test files this PR changes and the Ghidra tests thatmainchanged — 40 files: 1,142 passed, 8 skipped.:cortex-m,:raw,:bridge-sources,:m68k,:6502,:com,:dol) passed. The lanes that report it say"ok": trueand"mocked": false, with cleanup complete where reported.93cde07ff, which mergesmain7c755f214(fix(snapshot): report binding mismatches #8432, fix: retain address context cleanup failures #8417) without text conflicts. fix(snapshot): report binding mismatches #8432 replacedsnapshotMatchesBindingwithsnapshotBindingMismatch, sorawLoadCompatibility.test.tsnow asserts the mismatch it reports: a pre-fix(ghidra)!: distinguish unlisted instruction addresses #7823 Ghidra snapshot differs only in its profile digest, and a snapshot of another target names the target.npm run check:fast,docs:checkandformat:check— passed.npm run test:focused --with the 30 test files this PR changes and fix(snapshot): report binding mismatches #8432'sproviderSelectionMcptest — 972 passed, 8 skipped.verify:ghidra:cortex-mandverify:ghidra:rawpassed ("ok": true,"mocked": false, cleanup complete).874513032, which mergesmaina6caa79bf(refactor(composition): unify capability bindings and cleanup ownership #8441, ci(codeql): separate production scans from test fixtures #8450). Its one conflict was an import intests/boundary/providers/hopper/hopperAnalysisProfile.test.ts:mainmovedHOPPER_PROVIDER_IDENTITYtoHopperProviderMetadata.js, and this PR added therawLoadAtEntryimport, so both are kept.npm run check:fast,docs:checkandformat:check— passed.npm run test:focused --with the 30 test files this PR changes — 961 passed, 8 skipped.verify:ghidra:cortex-mandverify:ghidra:rawpassed ("ok": true,"mocked": false, cleanup complete).a1c564e26, which mergesmain6e9ee97a6:npm run check:fast,docs:check,format:checkandverify:module-boundaries— passed.npm run test:focused --150 files — 149 passed and 1 skipped; 2,622 tests passed and 16 skipped, all of them Windows- or Linux-only cases. The files are the 30 test files this PR changes, the tests that import the session, target-resolution and error modules the merge resolved, upstream's investigation, cleanup-retry and ESP flash tests from the conflicting commits, and thetests/conformance/contractsfiles.npx knip— the same single finding as onmain6e9ee97a6(an unused exported type insrc/process/DarwinHelperCache.ts), none in files this PR changes.verify:ghidra:cortex-mandverify:ghidra:rawpassed (below).13906c5f3, which mergedmain317bf3fe2, passed the same kinds of checks: 51 focused files with 1,489 tests passed and 43 skipped (36 of them inevmoleInterfaceProvider, which needs evmole), and knip matched thatmain.6565d11d4toc9435592a, ran the same kinds of checks. Their only failures (3 tests ond7622e821, 9 on6565d11d4, none in raw loading) also fail on unmodified570abe95fon this host.npm ci --ignore-scripts, which skips frida's optional binding). The lanes that report it say"ok": trueand"mocked": false.verify:ghidra:cortex-mandverify:ghidra:raw— passed ona1c564e26(1 Nov) and on13906c5f3(30 Oct):"ok": true, not mocked, process lineage verified with no descendants, cleanup complete; the Cortex-M lane covers all six variants.verify:ghidra:cortex-m— passed ona7451a04f, with its commands owned (no descendants, no workspace left), and onbeaa182df. Eight cases cover the six variants, each opened withoutentry_point. Each checks the language,TMode1 at the entry, Reset as the only external entry, LLVM's mnemonics, no function on the vector table, the odd-entry refusal and CLI/MCP agreement. A legacy target keeps its identity, a respelled base reuses the snapshot, a different variant gets its own, and a base without a variant is refused.verify:ghidra:raw— passed onbeaa182df. There, both lanes ran withoutmain'sfast-uri3.1.9 andqs6.16.1 patch bumps.:cortex-m,:raw,:m68k,:6502,:com,:dol,:bridge-sources) passed ond7622e821;:raw,:m68k,:6502,:comand:dolalso pass on the refactor commit893a02391.Compatibility, safety, and release
:cortex-m,:raw,:dol,:bridge-sources); earlier runs of all seven lanes used Ghidra 12.1.4, whichmainno longer accepts; no Hopper.Author readiness
Human owner: @Entrpi
Before merge
type(scope): outcome.