mirror of
https://github.com/morluto/rea.git
synced 2026-11-29 09:56:23 +00:00
dcbee09daeed306d44479e2ed9e664026046b4df
578
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8acf5e33a1 |
test(ghidra): forward the caller locale to native value verifier children
The verifier starts REA with a minimal environment. Without a locale a Linux JVM encodes file names as ASCII, so the socket boundary control's non-ASCII runtime directory became ??? and Ghidra could not start. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
afd860ec1b |
test(ghidra): read complete Evidence in boundary CLI comparisons
Over-budget CLI results now deliver a summary, so comparing the CLI function dossier with MCP read an absent normalized_result. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
72d6d275d4 |
test(ghidra): compare native value graphs by cited procedure across adapters
The real-Ghidra verifier required identical CLI and MCP dependency graphs, including upstream Evidence IDs. An MCP session states session limitations once and the CLI records the caller input path, so the same analysis has different record IDs in each adapter. Each adapter now checks that every cited ID is a linked procedure record of its trace, and the graphs are compared with those IDs replaced by the procedures they record. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
a91d9fa2b5 |
feat(firmware): decode ARM M-profile and RISC-V mtvec interrupt vector tables (#14421)
* feat(firmware): decode ARM M-profile and RISC-V mtvec interrupt vector tables * fix(firmware): name vector-table exceptions per ARM variant and report unbound SVD interrupts The architecture field now takes the ARM M-profile variant names REA uses for raw images (armv6-m through armv8.1-m.main) plus riscv. ARMv8-M Baseline gets ARMv6-M's exceptions; only Mainline names MemManage, BusFault, UsageFault, SecureFault and DebugMonitor. The old armv8-m value named Mainline faults on Cortex-M23 tables. vtor_aligned checks the 128-byte ARMv7-M/ARMv8-M minimum and is null on ARMv6-M, whose VTOR is optional and implementation-defined. Slots past the end of the 32-bit address space are no longer decoded with wrapped addresses, and an initial stack pointer that is not word-aligned is flagged. CMSIS-SVD interrupts without a name or with a non-integer value are reported as anomalies instead of skipped silently, and the expanded-name budget is charged once while parsing instead of twice with two formulas. likely_default_stub is removed: every shared-handler group set it to true. RISC-V limitations now cover vectored exceptions on slot 0, CLIC address tables and the mcause numbering assumed for SVD bindings. * fix(firmware): bound SVD anomaly diagnostics, RISC-V pair addresses, and shared budget recovery * fix(firmware): index SVD duplicates per peripheral and admit one-slot RISC-V tables Duplicate interrupt declarations were found by rebuilding a key that repeats the full peripheral name for every <interrupt>, so a long name repeated across many declarations cost name length times declaration count. Bound names are now indexed per peripheral name, looked up once per <peripheral>. The 8-byte minimum held for every architecture, but only an ARM table must start with InitialSP and Reset; a RISC-V Direct-mode table can be one instruction. max_entries and max_file_bytes now admit one slot. * refactor(firmware): hoist the SVD IRQ value patterns to module scope * fix(firmware): record RISC-V pair byte extent and attribute caller input errors * style(firmware): format the vector-table provider * fix(firmware): add summary delivery and analysis views for vector tables * test(firmware): check vector-table recoveries and budgets through their owners Recovery assertions compare the delivered action with the shared refusal formatter applied to the reported limit, instead of pinning sentences. The summary-delivery test set REA_AGENT_RESULT_MAX_BYTES, which nothing reads, and used a result large enough to exceed the default budget too; it now sets REA_AGENT_RESULT_BUDGET_BYTES, asserts the reported budget, and uses a result between the minimum and default budgets, checking that the default delivers it complete. The view counts active ARM entries and recognized RISC-V slots with a loop instead of filtered copies. * perf(firmware): count active vector slots once in the report producer The analysis view recounted active ARM entries and recognized RISC-V slots on every summary and page request. The producer already collects exactly those slots as handler targets, so the report now stores active_arm_entry_count and recognized_riscv_slot_count from them, and the view reads the stored fields. The service checks the stored counts against the slots once when it validates the provider's report. --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
f25312a8bc |
feat(labview): inspect RSRC containers and embedded VI trees (#13337)
* feat(labview): inspect RSRC containers and embedded VI trees Add inspect_labview_artifact, a static reader for LabVIEW RSRC containers in .vi/.ctl/.llb files and in LabVIEW-built PE resources. It reports the container header, the recorded LabVIEW version, the complete block inventory with each section's coding, and whether the block-diagram and front-panel heaps are present, without starting LabVIEW or any process. Only zlib-coded sections are decoded, for their byte count; no payload is returned. An absent block-diagram heap is reported as a limitation rather than reconstructed. * docs(labview): document RSRC inspection Describe the inspect_labview_artifact contract, section codings, and the block-diagram limitation, and list the target in the supported-targets table and the documentation index. * test(labview): cover provider admission for the RSRC reader Add the provider-admission coverage the repository requires for a new provider, without changing the reader: - Move the synthetic RSRC container builder into a shared test fixture so the unit and boundary tests build the same bytes once. - Add a CLI and stdio MCP boundary test for inspect_labview_artifact. - Register `rea-labview-rsrc` lifecycle coverage for operation and cancel. - Declare the `labviewArtifact` conformance case. - Regenerate the advertised catalog summary for inspect_labview_artifact. * fix(labview): require an absolute path in the inspection contract `inspect_labview_artifact` admitted a relative `path`, while every other caller-path contract requires an absolute one. The CLI/contract parity check caught it: the CLI resolves a relative argument before admission, so the contract must hold the absolute rule alone. Use `absoluteLocalPathStringSchema`, the schema the other caller-path contracts already use. * fix(labview): bound inspection work and preserve parse facts Address the review findings on the RSRC reader: - Bound the PE resource walk with a visited set, a total visit budget, directory-entry and container allowances, and a typed limit failure instead of a silently partial scan. - Check the resource directory and its data against the declared resource range rather than the whole file. - Cap zlib inflation at its declared length, add a total decoded-work budget, and recognise any valid zlib header instead of three byte pairs. - Check nested RSRC records against their declared data/info sections and cap the total section count across blocks. - Read the artifact through readStableArtifact so identity, bounds and cancellation bind to the bytes actually inspected. - Carry parse failures as ParseFailureError facts: malformed input keeps its kind/offset/field, and a limit becomes a typed fixed-allowance refusal instead of invalid_format. - Report heap presence as `unknown` when an embedded program tree or an unexamined container could still hold it, not as `absent`. - Cover cancellation that arrives after the read starts. - Move the analyst guide under docs/guides/native/. * fix(labview): retry retained cleanup and keep read failures distinct - Own the artifact resource scope and run each read through it, so a retained failed close is retried before later work and reported at shutdown. - Translate the read failure as recorded instead of replacing it with the signal's current state; the stable read owns its cancellation facts. - State the 256 MiB input ceiling as a fixed allowance so an oversized artifact keeps its structured maximum and recovery. - Match the guide to the decoded-byte behavior: a section over the budget is reported `unknown` and the inventory continues. * fix(labview): bound the version scan and keep cleanup on refusal - Replace the unbounded `\d+\.\d+` scan with a bounded single-pass search over the first 64 KiB of each vers section; a digit-only section no longer drives quadratic matching work in the shared server. - Classify read failures through the shared provider classifier with a LabVIEW dialect, so the size ceiling is restated as a fixed allowance and the read's cleanup, partial observation and cancellation facts survive the refusal. - Cover both with regressions. * fix(labview): reuse the shared PE layout and bound the decode work - Walk PE resources through readPeResourceLayout, so RVA lookup is indexed, a payload may map through any admitted section, and the home-grown section scan is gone. Add a total entry budget. - Charge every attempted inflation against the container's decode budget, including failed and length-mismatched attempts. - Bound block records by the list's declared extent, clamped to the container because real LabVIEW-built PEs declare more than the resource payload holds. - Reject a named section whose name leaves the list instead of reporting it as unnamed. - Pass the selected container to the parser without copying it. - Cover the PE path and the over-declared list extent with regressions. * fix(labview): bound repeated decodes and report unexamined coverage - Charge compressed input bytes as well as declared output, and memoize the decoding of one stored section, so records that share a stream do not repeat its work. - Keep a zlib-coded `vers` section's decoded bytes for the version scan. - Cap list records by both the declared extent and the info section. - Report PE walk coverage, and keep heap presence `unknown` for a `.llb` archive or an unreadable PE resource branch. * fix(labview): key cached decoding by block and section A section's coding depends on both its stored bytes and the block that declares it: LVzp is XOR regardless of the bytes, while another block may read the same bytes as raw or zlib. Include the block identifier in the memo key so a shared section keeps each block's interpretation. Cover the shared-section case with a regression. * fix(labview): derive block facts once and stop inferring format from names - Compute the block-diagram, front-panel and program-tree facts in one pass over the inventory and reuse them. - Check the visited set before charging the PE directory-visit budget, so aliases of one directory do not exhaust it. - Deduplicate aliased resource payload ranges before counting containers. - Report a direct RSRC container's heap facts as unknown: its content does not establish whether it is a VI, a control, or an archive of member VIs, and the caller's spelling is not evidence of format. * fix(labview): decode the packed version record and keep resource type - Read the LabVIEW version from the packed four-byte word at the start of a `vers` record instead of scanning the whole record as Latin-1, and report `version_coverage` so an undecodable record is unknown rather than absent. - Accept only RT_RCDATA (type 10) PE resource payloads, so the `pe-rcdata-rsrc` kind is accurate and a larger custom resource cannot win selection. * fix(labview): walk only the RCDATA subtree and validate packed digits - Walk only the RCDATA (type 10) resource subtree, so a shared directory reached under another type cannot hide the container and unrelated branches are not charged to the entry budget. - Reject a packed version word whose digit nibbles are not decimal; a damaged record is skipped and a damaged-only container reports `version_coverage: unknown`. - Derive the heap and program-tree facts in the parser and consume them in the provider, so one owner defines their meaning. * fix(labview): filter root resource entries before dispatch - Apply the RCDATA root-type filter before either target branch, so a root entry that points straight at a payload cannot enter the result. - Validate only the decimal major, minor and bugfix fields; the build field is not part of the reported version. * fix(labview): filter PE root types before dispatch and validate only reported version digits The RT_RCDATA filter ran only for directory targets, so a noncanonical root entry of another type pointing straight at a data entry could be counted and labelled pe-rcdata-rsrc. Filter the depth-0 type identity before either target branch, and share the RT_RCDATA constant with the PE resource facts owner. The vers check rejected a record whose build bits held a nibble above 9. Only major.minor is reported, and pylabview (decimal build digits) and the classic NumVersion layout (binary non-release revision) disagree on the build, so only the reported major and minor nibbles are validated. * fix(labview): resolve names against the shared list and keep read identity - Locate the one section-name list after every block's start table and use it for all blocks, so named sections before the last block keep their identity instead of reading a neighbouring table. - Retain the completed read's byte identity on later refusals and failed closes, so a parse failure still names the bytes that were read. * fix(labview): report why recognized zlib sections stay undecoded A valid RFC 1950 header with FDICT set was classified as uncompressed, so a vers section's four-byte length prefix was read as version 0.0. FDICT now marks the section as recognized-but-undecodable zlib. Each undecoded zlib section records its reason (preset dictionary, compressed-input or decoded-output allowance, or failed inflation), and the report names the fixed allowance that stopped it, so a capacity omission is distinguishable from damaged bytes. A PE whose RCDATA branch could not be read is no longer described as carrying no embedded RSRC resource. The RSRC magic and zlib header fields are named once and shared. * fix(labview): keep PE admission separate from an unreadable tree A file that does not declare `MZ` is not a PE, so it must not be reported as a malformed PE resource tree. The scan reports whether the file was admitted as a PE separately from whether the walk was complete. * fix(labview): take PE identity from the MZ owner and bound section tables A two-byte MZ check treated plain DOS MZ and NE/LE/LX images as declared PEs, so an ordinary non-LabVIEW file was reported as an unreadable PE resource tree. PE identity now comes from observeMzWindowsHeader: only a PE signature at e_lfanew declares a PE. The unused admitted field is removed. A section-start offset inside the count word or block-header rows was accepted and could fabricate an inventory from block metadata. Tables must start at or after the end of every block header; blocks may still share a later table. The refusal tests now assert the error type unconditionally. * fix(labview): report embedded parse failures in file coordinates A malformed RSRC embedded in a PE failed with container-relative offsets, but the refusal names the selected executable and carries no container.file_offset, so callers could not locate the failure. The parser now takes the container origin and moves a failure offset into the selected file's coordinates; successful results keep container-relative ranges with container.file_offset. * fix(labview): frame RSRC tables before applying their count allowances A damaged container declaring an impossible block or section count was refused as a capacity limit before its table extent was checked, so a truncated target surfaced as resource_constraint. Each table is now framed first; a fully framed table over its allowance is still a capacity refusal. * fix(labview): keep unread PE resource roots and rows out of observed absence A nonzero resource RVA whose file-backed run cannot hold one directory header returned complete coverage without reading anything, so the file was reported as carrying no embedded RSRC. Only a zero RVA is observed absence now; a short declared root is an unread tree. Directory rows were checked against the entry allowances before their extent, so a damaged directory declaring impossible counts surfaced as resource_constraint. Rows are framed first; a fully framed directory over its allowance is still a capacity refusal. * fix(labview): reject RSRC data sections that overlap the fixed header A data offset inside the 32-byte RSRC header let a section's stored-length word be read from header fields, returning a fabricated empty section as a successful inventory. A data offset below the header is now malformed. * fix(labview): check decode-omission guidance structurally and own the RSRC magic once The allowance test froze the delivered sentence. It now checks the parser's decodeOmissions fact and the effective allowance, and compares the public limitation with the provider's own formatter output. The RSRC magic was declared again in artifact recognition; it now has one owner in the LabVIEW domain contract, used by recognition, the parser, the PE scan and the provider. * feat(labview): summarize and page the RSRC inventory from retained Evidence inspect_labview_artifact returned every block and section inline, so an admitted container with 4096 named sections could exceed a megabyte and bypass the agent result budget. The tool now takes detail: complete keeps the inline inventory; summary, or omitted detail over the budget, returns container, version and heap facts with block and section counts, and the complete inventory is paged with inspect_analysis_view kind labview-artifact (blocks, sections, optional block filter) or read with evidence-json. The CLI delivers the same way. RSRC data and info ranges that intersect are refused as malformed rather than reading list metadata as section data. * test(labview): read the CLI report as the complete inventory The advertised output now admits complete or summary detail, so the test parses the complete report schema explicitly. * perf(labview): build view rows only for the requested page Each view call copied every section before reading the request, so a summary or one-row page did work proportional to the whole inventory. A section index (block and section position, and positions per block) is built once per immutable retained report and reused; summaries read counts from it, and section pages build objects only for selected rows. --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
742cdf0428 |
feat(artifacts): inventory systemd journal headers and object table offline (#10151)
* feat(artifacts): inventory systemd journal headers and object table offline Journals copied from a host or carved from a disk image had no reader, so an analyst needed journalctl and a live host to see what a file declared. Recognize the LPKSHHRH header by bytes and report it as its own artifact format. Parse the fixed 272-byte header: flag bits and their names, state, the four 128-bit ids, header and arena sizes, hash-table extents, and the object, entry, data, field, tag and entry-array counts. Anchor the object area on header_size, requiring an aligned offset inside the file, then walk the object chain front to back by each header's declared extent. Report totals by object type, the valid/truncated/unknown-type counts, a bounded window of 32 object headers with source offsets, and the trailing bytes the chain could not claim. Payloads stay undecoded: fields, entries, entry arrays, hash tables and compressed objects are reported as limitations rather than guessed, and the whole file is bounded at a fixed 4 GiB ceiling. * style(artifacts): format the systemd journal reader and its fixtures `format:check` fails on these three files, which breaks the Static checks lane and, through it, the CI required aggregate. `oxfmt` only reflows lines; no behaviour changes. * fix(artifacts): read journal objects the way systemd lays them out The object walk that shipped with the reader did not match the on-disk format, so a valid journal could be reported as truncated and an incompatible one could produce plausible but wrong evidence. - Advance to `align8(offset + size)` and validate the raw extent. systemd keeps a declared size unpadded and aligns only the next object's start, so a size that is not a multiple of eight is valid, not truncated. - Stop at `tail_object_offset` instead of at end of file. Bytes after the declared tail are the arena's preallocated capacity; walking them read a zero header as an extra unused object and called capacity corruption. - Stream the object chain instead of buffering the file. Payload bytes are skipped as chunks arrive, so a journal near the 4 GiB ceiling inventories in chunk-sized memory and cancellation between chunks is never queued behind a whole-file parse. - Read `tail_entry_array_offset` and `tail_entry_array_n_entries` with `getUint32`. They are adjacent 32-bit members added in revision 252; reading each as 64 bits folded the following field into both values. - Accept the 208-byte header that predates `n_data`, and read every later field only when the declared `header_size` covers it. Older acquired journals stay inspectable instead of classifying as unknown. - Refuse to describe objects when `incompatible_flags` sets a bit outside the known set. Such bits change the parser's assumptions, and a journal from a newer systemd would otherwise yield invalid object evidence. - Record fields whose declaration exceeds 2^53-1 in `overflowed_fields`, so distinct source values no longer collapse onto the same ceiling. - Report skipped compressed payloads only when a walked object actually carries a compression flag, not merely because the header advertises a compression algorithm. Regression tests cover the unaligned size, the declared tail with arena capacity after it, the 208-byte header, the compact 32-bit tail-array fields, the 2^53-1 ceiling, unknown incompatible flags, and the compression message. The decoder was also checked against every chunk boundary from one byte to the whole file: counts and offsets are identical. * style(artifacts): apply repository formatting * chore(systemd): merge main and read the journal through BinaryReader main's guards reject new raw DataView reads, so every header, object and state field now goes through BinaryReader, which bounds each read. Two offsets are write cursors rather than resource allowances, and each carries the not-an-allowance reason the budget rule asks for. * chore(systemd): apply oxfmt to the journal header helper format:check runs oxfmt, and the BinaryReader rewrite left one call wrapped across three lines that oxfmt wants on one. No behavior change; this is what turned the Static checks job red on the previous run. * chore(systemd): record the open_binary output schema summary The journal format adds artifact format metadata, which changes the open_binary output schema digest. Build package runs verify:advertised-schemas and rejects the stale summary, so commit the regenerated digest. Only the output compact hash moves; input schemas and patterns are unchanged. * fix(contracts): recognize damaged systemd journals by signature hasSystemdJournalHeader also required a usable header_size, so a journal with a short or unaligned header never reached SystemdJournalArtifactReader: normal inventory classified it as a plain file and dropped the header facts and the object-walk limitation the reader already reports. The malformed-header test only passed because it constructed the reader directly. Recognition is now the signature alone. Deciding whether header_size anchors the object area belongs to the owning reader, which keeps whatever it could read and records why traversal stopped. * fix(journal): separate undersized objects from truncation and bound the tail - An object declaring a size below its own 16-byte header is a contradictory declaration, not a file cut short: it is counted separately so the analyst is not told the writer was interrupted. - An object size above 2^53-1 now carries `size_overflowed` on its header record, matching how the header fields already report the ceiling. - Object extents are validated against the declared arena, not only the physical file, so a short arena is reported instead of accepted. - `tail_object_offset = 0` with `n_objects = 0` is an empty chain rather than an absent boundary; a declared tail the walk never reaches is reported as an incomplete object area. - `tail_entry_boot_id` is null unless the compatible `tail-entry-boot-id` flag is set, so the legacy boot id at the same offset is not published as a tail-entry identity. - A header the probe could not anchor reports `unread_fields`, so its zeroed numeric declarations are not read as observed values. * fix(journal): keep journal occurrences out of the executable role A recognized .journal with no special path role fell through to the default executable role, so every ordinary journal was inventoried as a program. The bytes are data, not code, so the format now keeps the resource role the same path would carry without a recognized content format. * fix(journal): report a short signed journal as truncated input The reader mapped every format failure to `malformed`, so a file that carries the signature and stops before the header shape was complete was reported as damaged structure rather than missing bytes. The signature is now read before the decoder runs, and a signed short file carries a `truncatedInput` cause; unsigned bytes keep `malformedInput`. * fix(journal): keep the legacy boot id and read flags once The 56-71 id has two readings selected by the compatible `tail-entry-boot-id` bit; nulling it when the bit is clear dropped a readable header value. Both names are now reported with exactly one non-null, and `readIdFacts` takes the compatible flags the caller already read instead of a second u32 reader. * Merge origin/main into feat/10123-systemd-journal Import systemdJournalMetadataSchema from androidAndSystemMetadata directly instead of the artifactFormatMetadata barrel. main moved format metadata into per-group modules; the barrel re-exports platform parsers that import back through resources, and the cycle left the schema undefined at module init, failing every SystemdJournalArtifactReader test. * test(filesystem): align stable artifact stream failures with split error reasons Upstream #14225 split reader path refusals from malformed target bytes and moved two stable-artifact contract breaks off ArtifactReaderFailure("format"): an invalid chunk size is now an internal invariant violation, and a descriptor returning an impossible byte count is an io failure. The suite still asserted reason "format" for both, so shard 9 and the required CI lane went red on every branch that re-merged main. Update the assertions to the reasons the producers now raise so the boundary suite matches the intended contract. * test(filesystem): assert path refusal for a directory entry in the reader suite DirectoryArtifactReader has refused non-file entries as reason "path" since the reader moved into src/resources (#11520), but the boundary test still expected "format", so the re-merged branch fails shard 4 with an ArtifactReaderFailure whose reason is path. Assert the reason the reader raises. * fix(artifacts): report unknown journal layouts as unsupported, not truncated A complete journal whose header sets an incompatible flag bit this reader does not know was refused through the signature-based path, which wraps every decode refusal in truncatedInput. Callers therefore told the analyst the artifact was invalid and to obtain a fresh copy, although no bytes are missing and a fresh copy cannot help. Carry an unsupported tag from the journal decoder through the artifact boundary so truncation stays reserved for genuinely short structures, and the public reason selects the compatible-decoder recovery. * fix(pe): accept systemd-journal as a PE overlay leading format Merging main brought the systemd-journal recognizer into the shared format union while this branch kept its own overlay list, so recognizeLeadingFormat no longer assigned to PeOverlayLeadingFormat and typecheck failed. Recognizers can name systemd-journal, so the overlay leading-format list has to include it. * fix(systemd-journal): bound the scan by its window, not a file-size ceiling - Drop the 4 GiB whole-file ceiling. It was justified by ENTRY_SIZE_MAX, which bounds one entry, while the scanner streams and retains one chunk plus a 32-header window whatever the file size. - Make the object-header window selectable: createJournalDecoder and the reader accept objectHeaderStart, so next_object_header_index can be followed to later headers. - Treat a zero arena_size as an empty arena rather than an absent one, and report declared arena bytes past the end of the file even when the readable objects and counts agree. - Re-verify the source before reporting a decoder failure, so a file that changes mid-read reports an identity failure instead of truncation. - Read the state byte through one lookup, so a header that cannot anchor its objects keeps its observed state; name the tail-entry-boot-id flag. * feat(artifacts): page format record headers past the inline window Inventory keeps a bounded window of per-record headers, and nothing could follow the systemd journal's next_object_header_index over MCP or CLI. inspect_analysis_view gains a generic `format_record_headers` inventory collection (#14919) that uses the existing offset and limit. - Each page re-reads the root file through its format's artifact reader, with the window started at `offset`, after binding the file to the parent inventory's root digest. A changed file fails with artifact_integrity_mismatch (container-identity) instead of returning shifted rows. - Memory is one read chunk plus one window. The read is a cancellable streaming scan, and the reader is released through the view's resource scope. - Formats plug in through two single lists: the domain's record total and the artifacts layer's window reader. The systemd journal is wired; NTFS $MFT is left to #14919 because its streaming decoder has no start index. - The journal metadata drops object_header_start_index and next_object_header_index, which nothing could follow; the page's coverage.next_offset is the one continuation. - The journal test builder moves into a shared fixture for reader and boundary tests. Refs #14919 * fix(artifacts): page record headers only from a caller-named file - Opening a file must not be selected by Evidence: subject.local_path is display metadata and can change without changing the Evidence ID. The format_record_headers collection now requires an explicit absolute `path`, which the CLI resolves like other caller paths. The root digest still binds that file to the inventory. - Keep a completed page when the reader fails to close. The view Evidence is attached to the cleanup failure as its partial observation, and the reader stays retained for retry. - Keep a completed page when cancellation arrives after it was read. * fix(artifacts): scope record-page file selection and cleanup to its owners - Name the page's file selector artifact_path. The CLI's caller-path rewrite of view.path also rewrote other views' semantic selectors, such as a devicetree node path, into host paths on Windows; artifact_path exists only on format_record_headers pages. - Run each page's read and release through the supplied resource scope, so a reader an earlier page failed to close is retried first and a new page is refused while that cleanup stays unresolved. * fix(views): own the record-page row type beside the view parent The parent module imported the inventory projector for the page row type, which closed an import cycle the analysis-view cycle check forbids. The type now lives in analysisViewParent.ts and its consumers import it from there. The CLI JSON-input schema test now expects view.artifact_path among the caller paths inspect-analysis-view resolves. --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
f6cf6a867f |
feat(firmware): decode ESP-IDF Non-Volatile Storage (NVS) flash partitions (#14436)
* feat(firmware): decode ESP-IDF Non-Volatile Storage (NVS) flash partitions
Add offline ESP-IDF v1/v2 NVS partition decoding via `inspect_esp_nvs`
(`rea inspect-esp-nvs`) with complete retained Evidence, `detail: "summary"`
and `inspect_analysis_view` (`kind: "esp-nvs"`) paging, linear O(N+M) v2
multi-chunk blob reassembly, slot-by-slot CRC recovery past damaged item
headers, fail-closed `partition_offset`/`partition_bytes` bounds validation,
and full capability conformance and provider lifecycle coverage.
* fix(firmware): follow ESP-IDF NVS page states, header rules and encryption layout
Page states now follow ESP-IDF's PageState constants (corrupt 0xfffffff0,
invalid 0, unknown otherwise), with the header CRC and whether entries were
walked reported separately. NVS encryption keeps page headers in plaintext,
so an encrypted page is reported as a valid page whose item headers are all
unreadable instead of as a header CRC failure.
Item headers follow Item::checkHeaderConsistency: span per type, BLOB_IDX
and BLOB_DATA chunk-index rules, and a variable item's span matching its
length. An inconsistent header is not trusted and the walk advances one
slot. Unrecognized types are no longer entries with unknown values, and
namespace index 0 items that are not definitions are reported instead of
skipped silently.
Adds float (0x24) and double (0x28) items, keeps the bytes of non-UTF-8
strings and keys, and marks older copies of a key superseded by a higher
page sequence number or a later slot. Spec constants are named once and
v2 blob reassembly moves to its own module.
* fix(firmware): preserve NVS key byte identity, summary retention, bitmap span checks and artifact handoff
* fix(firmware): preserve intact NVS values, copied blob chunks, unknown page versions and -0
* fix(firmware): report older copies of used NVS blob chunks instead of dropping them
An interrupted page move leaves an older copy of a BLOB_DATA chunk next to
the copy a recovered blob used.
|
||
|
|
61fb6cf68a |
feat(native): list Mach-O function starts and data-in-code entries offline (#14897)
* feat(native): list Mach-O function starts and data-in-code entries offline
The diff adds a static reader for LC_FUNCTION_STARTS and LC_DATA_IN_CODE
on one thin Mach-O or one selected slice of a universal file. Starts are
absolute VM addresses from ULEB128 deltas off the __TEXT vmaddr, and
each data-in-code entry reports offset, length, kind, and the function
start that owns its address, with one offset and limit applied to each
selected table and counts covering every entry.
inspect_macho_function_starts and inspect-macho-function-starts expose
that report, require architecture only for a universal file, and refuse
a combined table above max_entries with no partial result. The shared
load-command walk now yields each command once and stores the Mach-O
segment name and vmaddr on load regions, and the guides and limit docs
record coverage, paging, and the read and entry budgets.
* build: add advertised schema summary for inspect_macho_function_starts
* Address review feedback
* fix(native): bound function-start decoding and page before building rows
- Check each start against an interval index of executable segments, built
once, instead of scanning every segment per start.
- Walk LC_FUNCTION_STARTS once. Count and check every start and
data-in-code entry, but build result objects only for the requested page,
and resolve owners for that page during the same walk.
- Keep every declared Mach-O segment in the shared reader (macho_segments),
so a __TEXT with no file bytes still anchors the deltas, as
llvm-objdump does. LoadRegion no longer carries macho_segment.
- On 32-bit ARM, clear the Thumb tag (bit 0) from published starts and
report it as `thumb`, keeping the tagged value for the next delta, as
ld64 encodes and LLDB decodes. Wrap 32-bit images at 2^32.
- Intersect Evidence file ranges with the selected universal slice.
* refactor(native): normalize function-start format facts once
- One table, MACHO_DICE_KIND_NAMES, names data-in-code kinds for the
reader, the schema and the report check, which each had their own copy.
- Each linkedit command's dataoff/datasize is normalized once against the
slice (end, 32-bit fit, in-slice bytes) instead of the overflow check and
the in-slice length being recomputed in three helpers.
- Name CPU_TYPE_ARM, VM_PROT_EXECUTE and UINT32_MAX after their headers.
- Report coverage.text_not_at_header when __TEXT does not map file offset
0: llvm-objdump anchors the deltas on the __TEXT vmaddr and dyld on the
mach_header address, and they disagree there.
- Pin the fixture's expected starts to literal addresses.
* build: refresh the inspect_macho_function_starts schema summary after merging main
* fix(cli): keep lipo's flag name out of --architecture help text
The architecture help for four commands said "as lipo -thin does", which
the CLI option-alias check reads as a registered short flag `-thin`.
Describe the lipo behavior without spelling its flag.
* Revert "fix(cli): keep lipo's flag name out of --architecture help text"
This reverts commit
|
||
|
|
bbd1540d10 |
feat(yara): scan an admitted artifact with caller-supplied YARA rules (#14688)
* feat(yara): scan an admitted artifact with caller-supplied YARA rules Add inspect_yara_matches (CLI inspect-yara-matches), which runs the installed yara command (REA_YARA_COMMAND or yara on PATH) with caller-supplied rule files against one local file. The result lists matching rules with tags, typed metadata and string match offsets, bound to the SHA-256 of the scanned file and of each rule file. yara is launched with an argument list under owned process supervision. Its stdout is parsed as it streams, and the scanned file is re-verified after the scan. command_timeout_ms, max_output_bytes and max_matches are per-call arguments and runtime analysis settings with REA_YARA_* launch seeds; max_file_bytes is per call. String matches beyond max_matches are counted and coverage is partial. A rule compile error is an input error naming the rule file, and a missing yara command is reported as capability_unavailable without affecting other tools. REA bundles no rules and downloads nothing. * Address review feedback * fix(yara): keep the scanned file's observation when a rule file fails * fix(yara): require qualified Windows paths and resolve relative POSIX commands * fix(yara): stage owned snapshot, preserve CLI array bounds, and report file-size required_value * fix(yara): preserve relative includes, retain completed matches, order snapshot cleanup, and declare writesFilesystem * chore(yara): update advertised schema summary for inspect_yara_matches * fix(yara): handle regex arguments in include rewriter and retain completed matches across process cleanup * fix(yara): preserve raw include bytes and staged file identity across close * fix(yara): preserve completed rule identities and malformed-output primaries * fix(yara): bound rewritten rule staging and preserve cleanup cancellation * fix(yara): record completed rule identity before flushing rewritten includes * Address review feedback * Address review feedback * fix(skills): restore the macOS flat installer guidance this branch dropped The authored native-and-artifacts reference had lost main's macOS .pkg paragraph, so the generated Cursor plugin copy no longer matched it and the skill freshness check failed in docs, source tests and packaging. * fix(yara): classify compile errors by kind and keep unrecognized diagnostics yara 4.x prints compiler diagnostics in two forms, with and without a rule (cli/yara.c print_compiler_error). The include failure in the stub used a form yara never prints, so a real missing include was untested. Parse both forms once into severity, source, line, rule and message, classify the message by libyara's text (include, syntax, undefined, duplicate, unreadable file, other), and give one repair per kind present. Stderr lines that match no documented form are kept verbatim instead of only counted. * fix(yara): decode every meta escape yara prints and anchor diagnostic file names Meta strings: yara 4.x print_escaped_data also escapes an apostrophe and writes \a \b \v \f, so a meta value such as "author's" failed the whole scan as an unknown escape. Decode exactly the escapes yara writes, named after that function, and refuse octal forms it never writes. Diagnostics: a file name or message can contain "(N): ". Match the rule files yara was given exactly and end any other file name at the first location rather than the last. Name yara's EXIT_FAILURE. * fix(yara): keep an ambiguous diagnostic location unknown and scope duplicate advice A file name and a message can both contain "(N): ". Split an unnamed file only where one complete diagnostic remains; several splits leave the source and line null with the whole text kept, instead of shortening the file name or dropping the line to unrecognized stderr. Duplicate advice now covers string, tag and metadata identifiers within their rule, not only rule names. --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
3a8a717b02 |
feat(ghidra): set function signatures and define the types they use (#14859)
* feat(ghidra): set function signatures and define the types they use annotate_native_function accepts an optional C prototype, applied with USER_DEFINED source in the same transaction as the name and comments, verified by readback and rolled back with them on refusal. define_native_data_types stores caller-authored struct, union, enum and typedef definitions atomically under /rea_caller_defined and refuses existing names. inspect_native_data_type reports those types with source caller-defined, and annotation readback reports the applied prototype and its source. Refs #14831 * feat(ghidra): bound caller C text with launch controls and refuse unapplied constructs The lengths of a signature and of type declarations and the nesting depth of parentheses are launch-only REA_ controls with measured defaults, floors and maxima, written into the bridge's session descriptor. A refusal names the control, its effective value, source and range. The bridge tokenizes caller C before Ghidra's parser sees it and refuses what that parser accepts without applying: attributes, storage-class specifiers, variable declarations, directives other than #pragma pack, literals, function bodies, default arguments, unnamed enums and repeated member names. A type name that names different types is refused. When a function has no calling convention and the prototype names none, the compiler specification's default convention, which Ghidra already uses to assign the locked storage, is recorded, and annotation readback reports the convention. Refs #14831 * fix(ghidra): apply the signature bound to the caller's text The bridge appended the semicolon its parser needs before checking the length, so a prototype of exactly the admitted length was refused. The readback prototype is documented as reusable only when its function and type names are C identifiers. Refs #14831 * chore(mcp): refresh advertised schema summaries for Ghidra type edits Refs #14831 * fix(ghidra): bound caller C text per call and report dropped qualifiers Ghidra's C parser cannot be cancelled, so REA bounds the text it parses. The three launch-only environment controls left an agent that hit them with a restart as its only recovery. The two length bounds are now per-call parameters, signature_max_utf16 on annotate_native_function and declarations_max_utf16 on define_native_data_types, with the same defaults and measured maxima. A refusal reports details.limit with control_kind "parameter" and required_value, the text's length, so the generated recovery names the value to pass or asks for shorter text. The text fields no longer carry a schema maximum, so every over-length refusal is typed. Parenthesis nesting is a fixed ceiling of 8 levels, registered as a representation bound, because each level doubles parse time. The session descriptor no longer carries C parser limits, and the config module, environment entries and restart-only registry rows are removed. const and volatile are still applied without effect, because Ghidra's types have no representation for them. Both edits now return dropped_qualifiers with each qualifier's line and column, and for a signature its parameter index, null for the return type, instead of dropping them silently. * fix(ghidra): read caller C through one tokenizer and bound nesting per call The C admission scan tracked lines only at LF and read directives as raw lines matched by a regular expression, so a CR-only line break shifted dropped-qualifier positions and a trailing comment on #pragma pack was refused. One tokenizer now owns caller C positions, comments and literals: CR, LF and CRLF each end a line as in Ghidra's parser, and directives are admitted from its tokens, so comments read as whitespace there too. A block comment that would carry a directive onto another line is refused. Parenthesis nesting was a fixed ceiling justified by parse time, a resource limit. It is now the per-call parenthesis_max_depth (default 8, range 1..12) on both type-edit tools. The bridge measures the deepest nesting over the whole text and sends it, with a text's length, as the wire failure's required_value, so details.limit reports the bridge's own measurement instead of the adapter re-reading the request. The tokenizer also decides whether a prototype is terminated, so the parser sees the caller's text unchanged: no leading whitespace is stripped, and a trailing line comment no longer swallows the appended terminator. * fix(ghidra): parse caller C inside the edit's rollback and refuse parser diagnostics Ghidra's C parser writes the type database even with storeDataType false: a definition whose name matches an existing empty composite fills that type in place, in the parser's own nested transaction. Both type edits parsed before opening their transaction, so a refused definition, such as one conflicting with a DWARF placeholder, left that placeholder filled. Parsing, validation and storage now share the edit's one transaction, and parseCallerC refuses to run outside one. The parser also records diagnostics it cannot apply, such as a repeated enumerator it drops, and still reports success. Both edits now refuse any diagnostic with Ghidra's message, before anything is stored. The real-Ghidra verifier gains a phase with an ELF object whose DWARF declares an opaque struct, proving a refused definition leaves that empty composite unchanged, and refuses a repeated enumerator. * fix(ghidra): admit caller C from one audited table of tokens Ghidra drops Review kept finding one more construct Ghidra's C parser consumes without applying, because admission listed spellings piecemeal. The tokenizer now owns one table, audited against every token and production of Ghidra 12.2's C.jj and checked on Ghidra 12.2, in that grammar's own spellings: - Refused, because meaning is lost: __ptr32 and __ptr64 (stored as a native-width pointer), __near and __far, every attribute, declspec, __readableTo, alignas, packed and asm spelling, [[...]] attributes, storage and inline specifiers including __forceinline, __pragma and _Pragma, _Static_assert, Objective-C @ blocks (Ghidra skips their whole text), and backslashes. - Reported in dropped_qualifiers as pure qualifiers: every const and volatile spelling, restrict, __unaligned and __w64. #pragma pack is admitted only in the operand forms Ghidra applies as written with a decimal value; (0x1), (010), (show) and (pop, n) were ignored or read differently, and "# pragma" is a line marker Ghidra skips. An enum tag that neither the text nor the database defines made Ghidra invent an empty enum without a diagnostic; declarations now refuse it as they do an invented struct or union. Identifiers admit $, as C.jj's do, and the tokenizer reads numbers and [[ as single tokens. * fix(ghidra): bound caller type depth, admit only constant expressions Ghidra evaluates, refuse unmatched pack pops Recursion: the tokenizer's [[ lookahead re-entered next() for each "[", and the dependency walk recursed per pointer, array and member level. Both are iterative now. Ghidra 12.2's own data-type code recurses too: 1024 pointer or array levels resolve, 2048 exhaust the stack inside addDataType while its database lock is held, leaving the Program unable to save. Every parsed type's chain through pointers, arrays, typedefs and members, including existing database types, is now measured iteratively and refused beyond a fixed 256-level ceiling before Ghidra walks it. An unexpected StackOverflowError ends the session with a reason instead of being caught by the parser call, since Ghidra's lock may then be held. Constant expressions: Ghidra leaves names, casts, sizeof, floating and binary literals unevaluated and substitutes a default, so "MASK = FIRST << 4" was stored as 2, and it truncates values outside int. Enum values, array sizes and bit-field widths are admitted only as integer literals with arithmetic, shift, comparison, bitwise and logical operators, checked iteratively with C's rules to stay in int, including implicit enumerator values; anything else is refused at its position. Pragma pack: Ghidra ignores a bare (push), a pop with nothing pushed keeps the current packing, and a plain pop pops past labelled entries. The tokenizer tracks admitted pushes and admits a pop only when Ghidra's result matches C's. * fix(ghidra): admit constant expressions only as one literal, skip absent pointer targets, state the type-depth recovery truthfully Constant expressions: emulating C against Ghidra's own evaluator is an open-ended class of mismatches (comparisons, unsigned arithmetic such as ~0U >> 1 giving -1, names, casts, truncation). The evaluator is removed. Enum values, array sizes and bit-field widths are admitted only as one decimal or hex integer literal within int, optionally negated, without suffixes; anything else is refused at the first token that leaves that form, and the refusal says to write the computed value. Implicit enumerator values are still checked against int. Dependency walk: Ghidra's generic pointer has a null pointed-to type, and pushing it onto the ArrayDeque threw. Both the dependency and depth walks now take children from one cTypeChildren and skip an absent child. Type depth: the depth is measured over the whole chain before comparing it with the limit, so the refusal reports the depth it used, and it names the type from the parser's table rather than walking the type for a name. The recovery no longer suggests splitting into named types, which cannot help because depth counts through typedefs and existing types; it says only fewer nested levels do. * refactor(ghidra): refuse parentheses in definitions and keep parenthesis_max_depth on signatures only Under the literal-only rule for constant expressions, every parenthesis in a define_native_data_types text already ended in a refusal (function declarators, attributes, casts, sizeof, or a Ghidra diagnostic for a grouped declarator), so parenthesis_max_depth changed only which refusal a caller saw. A definition now refuses its first parenthesis at its position, and the parameter is removed from that tool's schema; it stays on annotate_native_function, whose prototype has a parameter list. * fix(ghidra): refuse distinct types that share one parser name Ghidra keeps struct tags, enum tags and typedefs in separate maps. Combining those maps dropped a typedef such as typedef int item when struct item was also defined, and the call still succeeded. Overlapping names are stored only when the definitions are equivalent, which keeps typedef struct s { ... } s as one struct. Any other overlap is refused with conflicting_type_definitions before the transaction stores anything. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(ghidra): roll back a composite the parser fills in place Ghidra's parser replaces an empty composite during parsing and returns that same object. A later same-path check would store the fill as unchanged. Record those empty composites before parsing and refuse if parsing fills one, so the open transaction restores them. A different layout of a non-empty caller type still conflicts and leaves the stored type in place. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(ghidra): close line comments at EOF and refuse overflowing pack values Ghidra's // skip token requires a line break, so a comment at the end of declarations or of an already-terminated signature was rejected. A newline is appended whenever the text ends in a line comment, before any semicolon added for an unterminated prototype. Integer.parseInt drops a pack operand outside a Java int and leaves the previous packing, so #pragma pack(2147483648) stored a natural layout. Decimal pack operands are admitted only when that parse succeeds. Co-authored-by: morluto <morluto@users.noreply.github.com> * test(ghidra): assert the empty-composite refusal by code and readback Defining a struct over the DWARF placeholder fills that empty composite during parsing, so the refusal is data_type_conflict before the old name-conflict message. The verifier checks that code and that the placeholder still has no fields. Co-authored-by: morluto <morluto@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com> |
||
|
|
0f5ab1e042 |
feat(artifacts): inspect Debian package control metadata and contents (#10689)
* feat(artifacts): inspect Debian package control metadata and contents * fix(deb): throw ParseFailureError and record the new tool's schema counts DebPackageFormatFailure now extends ParseFailureError, as the architecture guard requires of parser failure classes; its kind, partial and message are unchanged. The advertised-dialect baseline takes the counts the inspect_deb_package input schema adds ($schema in both profiles, and allOf, default, examples, the \/ escape, the unanchored path pattern and untyped nodes in the full profile). * docs(deb): say dpkg runs maintainer scripts, not dpkg-deb dpkg-deb only reads the archive; installing with dpkg is what runs the maintainer scripts. Correct the spec so the safety rationale names the right tool. * refactor(deb): project format failures through parseFailureAnalysisError The provider now maps DebPackageFormatFailure with the shared parseFailureAnalysisError instead of its own instanceof ladder, passing the partial ar/control/data observation as diagnostics. The helper takes that optional diagnostics argument. DebPackageCapacityFailure extends ParseFailureError<"limit"> with the resource and maximum as its limit, and the provider keeps its limit recovery. * test(deb): resolve inspect_deb_package from its contract family The CLI acceptance and MCP boundary tests now take the contract from DEB_PACKAGE_TOOL_CONTRACTS instead of the full catalog, as the testing guide asks of focused contract tests. * fix(deb): require debian-binary and a control file for complete coverage Coverage was complete with a missing or empty debian-binary, or a control.tar that held no control file. It now needs a known format version and the control file as well as the control and data members, and each gap adds a limitation. * fix(deb): count hardlinks in the md5sums path cross-check dpkg lists every name of a hardlinked file in md5sums, while tar stores the later names as hardlink entries. The cross-check inventory now takes hardlink paths as well as regular files, so those names are no longer counted missing. * fix(deb): decode xz only when its index declares a size within the limit The sync @napi-rs/lzma decoder takes no output bound, so a member whose index could not be read was decoded with no limit and checked only after allocation. decodeXz now refuses such a member, as truncated when the footer is missing and malformed otherwise, before calling the decoder. * fix(deb): leave the md5sums cross-check unknown when an input is unread md5sums that is not UTF-8 counted as zero listed paths, and a package with no data.tar counted as an empty inventory. The cross-check is now computed only when both were read; otherwise it stays null and a limitation says which input was missing. * fix(deb): refuse Version and Installed-Size values the output schema rejects A Version with an empty upstream part or Debian revision (1:, 1:-1, 1.0-) and an Installed-Size past the safe integer range reached DebControl and failed the output schema, so the service lost the report. The parser now records a malformed field issue and leaves the value null. * build(deb): declare src/deb as a provider module layer Main now requires every top-level src unit in UNIT_LAYERS. src/deb is a provider like src/sqlite, and its two type imports of application ports are recorded in the upward-import baseline the same way. The xz spy binding now accepts the string or bytes input XzApi.compressSync takes. * fix(deb): keep tar names and link targets as stored Read ustar name, prefix and linkname fields, and GNU long names, as NUL-terminated UTF-8 without trimming or rewriting backslashes, and keep spaces in md5sums paths. A name that is not UTF-8 is shown with U+FFFD replacements and counted in a limitation, since it may not match md5sums. * fix(deb): read control files from the control.tar root only Look up control, conffiles, md5sums and maintainer scripts by their normalized root path, so a nested subdir/control or subdir/postinst no longer stands in for the root file. * fix(deb): read PAX records by byte length PAX record lengths count bytes, so walk the extended header bytes and decode each record on its own. A UTF-8 path no longer swallows part of the next record. A path or linkpath record that is not UTF-8 is counted in the same not-UTF-8 limitation as ustar names. * fix(deb): keep unreadable relationship alternatives as issues Accept hyphenated architecture qualifiers such as kfreebsd-amd64, and have parseDebianRelationshipField return the alternatives it cannot read. parseControl records each as a malformed issue on its field, so the package reports partial coverage instead of dropping a dependency. * fix(deb): deliver the whole partial report on a refusal A Debian package refusal now carries the bounded partial report as diagnostics.partial, so control facts, relationships, maintainer-script facts, ar member offsets and file rows read before the failure reach CLI and MCP callers, not just member names and a count. * fix(deb): decode only the maintainer script interpreter line interpreterLine now finds the first newline in the script bytes and decodes only the #! line, so non-UTF-8 bytes later in the script, or a cut through a multi-byte character at byte 256, no longer hide a valid interpreter. * fix(deb): bound unreadable relationship diagnostics per field parseDebianRelationshipField now counts unreadable alternatives and keeps only the first, and parseControl records one issue per field with that count and the first term cut to 120 characters, so a field of many `|` separators no longer grows the report with its input. * test(deb): check parser guidance through its owning formatters Export undecodableTarNamesLimitation and unreadableRelationshipsDetail from the parser and assert delivered limitations and issue details through them, so wording edits change one place. * fix(deb): bound PAX header work before each tar entry Keep only the path and linkpath PAX keys the reader uses, set in place rather than copying an accumulated object per header, and refuse more than eight GNU long name/link or PAX headers before one entry as malformed, so a run of short PAX headers cannot stall the server. * fix(deb): apply PAX owner records to the following entry PAX uid, gid, uname and gname now override the fixed ustar fields, which can hold shortened or fallback values. A uid or gid that is not a safe decimal integer falls back to the fixed field. * fix(deb): keep GNU ar string tables as counted members A // string-table member is now kept in the ar inventory and counted against max_ar_members like any other member. As an unknown role it is listed in extra_member_names, so coverage reports partial. * fix(deb): honor PAX size records and escaped md5sums names - A PAX size record overrides the next entry's ustar size field. Reading and skipping by the header field reported an empty file and then parsed its data as a header, refusing a valid archive. - GNU md5sum writes a leading backslash and escapes names that contain a backslash, newline or carriage return. Those lines were dropped, so the cross-check counted listed files as missing; they are now read, and lines that are not digest lines are counted in a limitation. * fix(deb): bound relationship alternatives and read PAX headers faithfully - Count relationship alternatives across the control file before building any, refusing more than a fixed 65,536; a field of '|' separators within the control budget could build millions of report objects. - Refuse a PAX extended header whose record length is unreadable or runs past the member, instead of using the fields read so far. - Keep global (g) PAX values for every later entry and per-file (x) values for the next entry only; global values were cleared after the first file. * refactor(deb): drop an unused import * chore(mcp): drop the dialect baseline main retired in #10693 * fix(analysis-view): call completeWithinViewCoverage with main's single count Main dropped its redundant second argument; both arguments were the same count here. * test(mcp): record this PR's advertised-schema summary Add the advertised-schema summary for inspect_deb_package, generated with npm run verify:advertised-schemas -- --update-summary. * fix(deb): bound repeated global PAX text and accept xz stream padding A global PAX path, linkpath, uname or gname is copied into every later row, so each reuse is now charged to the member byte budget (max_data_bytes or max_control_bytes) and refused before the row is added. An empty global PAX value now deletes the earlier global override, so later entries read their header owner again. xzUncompressedSize and the footer check skip trailing zero Stream Padding in 4-byte groups before locating the footer, so valid padded xz members are no longer reported as truncated. * fix(deb): trim trailing tar path slashes with a backward scan The unanchored /\/+$/u retried from every slash, so a PAX path or md5sums name made of a long slash run and a final non-slash took quadratic time. logicalTarPath now trims trailing slashes with a linear charCodeAt scan from the end. * fix(deb): parse global PAX owner ids once per global record Global uid and gid values were run through paxId for every later entry, and the repeated-text budget skips numeric keys, so a long global owner value was rescanned once per row. Parse them when the global record is read and reuse the numbers. * refactor(deb): report coverage with the shared coverage status schema * refactor(deb): classify provider failures through classifyProviderFailure * fix(deb): bound resolved ar member names before copying them GNU ar /N references can repeat one string-table entry without charging its text to any budget, and every resolved name is copied into the report and its Evidence. Refuse a BSD or GNU long name above 4096 bytes before it is read or sliced, so repeated references cannot expand a small table into large report text. * test(deb): register the debPackage capability conformance case debPackage is declared in CAPABILITY_DECLARATIONS but had no entry in PROVIDER_CAPABILITY_CONFORMANCE, so the conformance suite failed for it. Name the existing Debian package CLI acceptance test as its case. * fix(deb): flag repeated control and data members as extra Only the first debian-binary, control.tar*, and data.tar* member is read. A later member with the same role was neither decoded nor listed, so a package with an empty first data.tar and a populated second one reported complete coverage. Repeated members now land in extra_member_names with a limitation, which keeps coverage partial. * refactor(deb): use the shared excerpt and error message owners The architecture guards from main count a hand-written ellipsis cut in the relationship issue detail and two inline error-to-message copies. Use ellipsisExcerpt and errorMessage instead. * refactor(deb): move DebPackagePort to src/ports/deb The provider imported its port from the application layer, which needed an upward allowance in the module-layer baseline. Put the port beside the other provider ports and drop the allowance. * fix(deb): record only caller-selected budgets in Evidence Omitted inspect_deb_package budgets no longer appear in Evidence parameters as if the caller set them; only supplied fields are kept. * fix(deb): report fixed reader allowances as limits The ar member name, tar extension header, and relationship alternatives allowances stop inspection without showing the input is invalid. Report them as `limit` parse failures (DebPackageAllowanceFailure) with the partial report attached, and project them as resource_constraint with a fixed-allowance recovery instead of invalid_request. * fix(deb): refuse GNU ar long name references outside the string table A `/<offset>` reference past the end of the `//` string table, or one that lands on an empty entry, resolved to an empty member name. The report then failed debPackageSchema and callers got AnalysisOutputError with no file identity or partial facts. Check the offset and the resolved name, and refuse as a malformed DebPackageFormatFailure that carries the partial report. * fix(deb): align ar members by stored size and require padding Advance past each ar member using the stored header size, so a BSD #1/N extended name with odd length keeps the next header aligned. Refuse an odd-sized member whose padding byte is missing at end of file instead of reporting complete coverage for a truncated container. * fix(deb): trim NUL-terminated header fields in linear time Trim fixed-width ar and tar header fields at the first NUL with indexOf instead of a NUL-to-end regex, which retried from every NUL when a continuation line followed a NUL run. Control-field decimal parsing no longer applies header NUL trimming. * fix(deb): skip the tar path prefix on GNU headers GNU tar headers use the 345-499 region for atime, ctime and sparse data, not a POSIX path prefix. Only join the prefix when the header carries the POSIX "ustar\0" magic. * docs(readme): drop duplicated target tables in five translations The fa, ko, th, zh-TW and zh guides carried the target table twice. Restore each to upstream and add the single Debian packages row. * fix(deb): report oversized Zstandard windows as a fixed allowance A valid control or data zstd member can request a decoder window above the fixed 128 MiB ceiling. Node raises ZSTD_error_frameParameter_windowTooLarge, which the parser reported as malformed. Map it to a DebPackageAllowanceFailure naming the new zstd_window_bytes allowance, matching ZipArtifactReader. * fix(package): bundle XZ decoder binaries for every plugin host The plugin archive is produced on Linux x64, where npm ci drops other platforms' optional packages. The packaging step only restored the PTY binaries, so Codex plugin installs on macOS and Windows had no @napi-rs/lzma binding and valid XZ packages failed as unsupported. Derive the platform packages from the locked runtime tree instead: every optional dependency of a runtime package that targets darwin/linux/win32 on x64/arm64 is restored at its locked path with a verified integrity, and the packed archive is checked for each one. * fix(deb): keep only applied PAX keys while reading records parsePax stored every record's key before PAX_KEYS filtered them, so one extended header of many short records with distinct keys grew an object property per record before any entry limit ran. Records whose key is not one this reader applies are now read and dropped, and parsePax is covered directly in DebPackageParser.test.ts. * Address review feedback * Trim deb822 lines with linear scans The trailing-whitespace alternative of the shared trim expression retried from every position of a long interior whitespace run, so a package Description could take quadratic time. Scan from each end instead and cover a long tab and space run in a test. * fix(deb): read only the first control paragraph parseControl used the first paragraph of the control file, but deb822Paragraphs built a map for every paragraph first. A control file of many small paragraphs could allocate millions of maps within the decompressed-size budget. deb822Paragraphs now takes a paragraph limit and yields string lines lazily, and parseControl stops after the first paragraph. * fix(deb): report unreadable tar modes as null A tar header whose mode field is not octal was reported as mode 0000, which invents a permission the archive never stated. Report the mode as null and add a malformed issue for the member, so coverage is partial. * fix(deb): refuse GNU sparse tar entries GNU PAX sparse headers (GNU.sparse.*) rename the following entry to a synthetic GNUSparseFile path and store only mapped segments, so reading it as a regular file reported the wrong name and size and could miss md5sums cross-checks. Old GNU sparse (S) entries can also carry extension blocks their size field does not count. Refuse both as an unsupported format instead of reporting wrong file facts. * refactor: use shared artifact inspection for Debian packages * fix(deb): report per-call budget refusals as parameter limits * Address review feedback * Address review feedback * fix(deb): bound xz decoding, inherit global PAX size, and redact Homepage URLs * fix(deb): bound xz index preflight memory and preserve typed cancellation with partial facts * fix(deb): bound nested relationship lists, align tar stored-body rule, and scope async parse * fix(deb): walk actual XZ block boundaries, scan control lines without arrays, and guard XZ close gate * refactor(deb): avoid throwaway filter arrays in DebPackageParser --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local> |
||
|
|
47daa05a84 |
feat(pe): report the overlay appended after a PE image's last section (#13245)
* feat(pe): report the overlay appended after a PE image's last section * chore(schemas): add the inspect_pe_overlay schema summary * test(pe): expect the shared non-PE refusal message in MZ admission * test(cli): record completion goldens for inspect-pe-overlay * fix(pe): preserve overlay diagnostics and validate certificate spans Keep impossible security directory spans in measured overlay bytes and share bounded format recognition with inventory. Validate structured overlay facts in the domain while preserving provider diagnostics. * docs(pe): move the PE overlay guide under docs/guides * fix(pe): keep overlay format recognition within its probe * Address review feedback * fix(pe): keep header anomalies in the overlay report parsePeOverlay dropped pe_header_anomalies from readPeImage, so a SizeOfHeaders that ends before the section table reached the overlay report without its warning. Carry header_anomalies through the output contract and Evidence result, as the certificate, import and load config reports already do. * Address review feedback * fix(pe): report adjustable max_file_bytes budget and preserve omitted caller parameters in inspect_pe_overlay * fix(pe): preserve required_value on file-size limit and use executeArtifactInspection in PeOverlayService * chore(schemas): update inspect_pe_overlay advertised schema summary * fix(pe): include bflt in PE overlay leading formats * test(pe): import BINARY_DIAGNOSTICS_TOOL_CONTRACTS in PE overlay tests --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local> |
||
|
|
2c89136469 |
feat(artifacts): inspect VS Code extension packages offline (#12469)
* feat(artifacts): inspect VS Code extension packages offline REA had no owner for a local .vsix ZIP. inspect_vsix_package and inspect-vsix-package now read extension.vsixmanifest and extension/package.json, report identity disagreements, engine range, activation events, a contributes summary, hashed native/wasm/executable members, and a ZIP inventory without installing the extension or contacting a marketplace. Missing or malformed manifests return the inventory with limitations. Invalid ZIP input fails without partial success. Signature files are reported present or absent and are not verified. * fix(vsix): bound vsixmanifest XML nodes before building the tree A compressed extension.vsixmanifest within the 16 MiB byte budget can still expand into millions of XML nodes. Count nodes as a stream first, as the Maven POM reader does, and refuse the manifest with an xml_nodes limit before parseXmlDocument allocates its document. * fix(vsix): report the vsixmanifest node ceiling as a fixed allowance The xml_nodes limit is a fixed parser ceiling, not a caller budget, so the provider fell through to a generic memory refusal that implied more memory could help. Map it through fixedAllowanceOptions as the Maven provider does and cover the public error from the provider. * refactor(vsix): classify provider failures through the shared owner VsixPackageProvider kept its own chain for cancellation, identity, path, selected-file and cleanup failures. It now supplies a dialect to classifyProviderFailure with only the package's own refusals: its parse ceilings and budget recovery, format failures, fixed reader allowances and the max_file_bytes refusal. The held snapshot still supplies the completed identity for a parser failure after the read. * fix(vsix): report an empty contributes key instead of failing the report A package.json with an empty contributes key produced a key with an empty name, which the contract refuses, so the whole inventory was rejected. The empty key is now left out of contributes.keys and reported as a limitation. * fix(vsix): charge member decoding to one package-wide budget Each hashed member was read with a fresh per-member budget, so a small compressed package with thousands of members could make the parser decode several GiB. Member reads now draw on one artifactExpansionBudgetBytes budget for the package; once it is spent, remaining members stay in the inventory without a digest and a limitation names the spent budget. * fix(vsix): resolve dot segments in package.json entry points packageJsonEntryPath stripped only one leading ./, so a main such as ./out/./extension.js named extension/out/./extension.js and was reported absent even when extension/out/extension.js existed. Entry points now resolve . and .. segments under extension/; a path that climbs out of extension/ keeps its unresolved form and matches no member. * fix(vsix): resolve entry points with the loader's lookup rules An extension-less main such as ./out/extension was looked up as a literal ZIP name and reported absent although Node resolves it to extension/out/extension.js. main now tries Node's CommonJS file and directory suffixes, browser tries the .js the web extension host adds, and the reported path is the member found. * fix(vsix): resolve a directory main through its own package.json Node's directory lookup reads the directory's package.json main before falling back to index files, so an entry like main: ./out with out/package.json naming ./start.js now resolves as present. * Address review feedback * fix(vsix): report interesting member sizes past 4 GiB A ZIP64 member can declare an uncompressed size above 0xffffffff while the compressed package stays under max_file_bytes. The parser skips hashing it and reports the declared size, but interesting_members[].bytes used the 32-bit uint schema, so the service rejected the whole report. The field now takes any nonnegative integer, matching contents[].uncompressed_size. * fix(vsix): report a malformed directory package.json instead of its index When main names a directory whose package.json is not a JSON object, Node's loader throws ERR_INVALID_PACKAGE_CONFIG rather than falling back to index.js. Keep that outcome distinct from a manifest with no usable main: mark the entry point absent and add a limitation naming the member. * fix(vsix): classify Java archives as nested archives A bundled .jar, .war or .ear is a ZIP, but the path classifier returned unknown for it, so it was never hashed or counted as a nested archive. * fix(vsix): match entry points by exact member case Resolve main and browser entry points against exact ZIP member names, as a case-sensitive file system would, and report a member that matches only when case is ignored as a limitation instead of marking the entry present. The directory package.json used to resolve a directory main is matched exactly too. * fix(vsix): keep directory-only intent for a trailing-slash main A main such as "./out/", ".", "..", or one ending in "/." or "/.." can only name a directory under Node's loader. Normalizing it to a bare path let a sibling file like extension/out.js match and report the entry as present. Carry a directory-only flag from the raw value and skip file candidates in the declared-path lookup and in the check that decides whether to read <main>/package.json. * fix(vsix): only blame case when the spelling differs The case-only entry point warning scanned index candidates even when a malformed directory package.json had already stopped the main lookup, so an exact extension/out/index.js could be reported as a case mismatch. Skip index candidates when the directory manifest is malformed, and skip any candidate whose member is spelled exactly as declared. * fix(vsix): stop main lookup at an over-budget directory package.json When main names a directory whose package.json exceeds max_manifest_bytes, its main is unknown, so falling back to index.* could report a file Node would not load. Treat the unread manifest like a malformed one: report main unresolved, add a limitation that says the index files were not used, and skip the index files in the case-only scan. * fix(vsix): resolve a main that normalizes to the package root A main of ".", "./" or "./out/.." normalized to "extension/", so the directory lookups searched "extension//package.json" and "extension//index.js" and reported a present index file as absent. Return "extension" for the root so those lookups name real members. * fix(vsix): stop main lookup at an unread directory package.json An encrypted or duplicated directory package.json left the directory main unresolved as "none", so lookup fell through to index files even though the unread manifest may name another file or be invalid. Mark it unread and stop the lookup, as the over-budget branch already does. * test(vsix): tag the decode-budget regression long-running The package-wide decode budget test passed a fixed 60-second deadline, which also turned off coverage and CI deadline scaling. Use the long-running tag the testing guide prescribes instead. * fix(vsix): leave unread dependency declarations unknown A missing, encrypted, or malformed manifest reported its extension dependencies and extension pack as empty lists, so a declaration on the other side showed up as a disagreement. Report the unread side as null and only flag a disagreement when both manifests were read. * fix(vsix): look up entry points by their literal text package.json main, browser, and a directory package.json main were trimmed before lookup. A ZIP member name can begin or end with whitespace and Node does not trim the specifier, so "./out/start.js " was reported absent or matched the different "out/start.js" member. Use the declared text as written; only an empty string names nothing. * fix(vsix): keep activation events literal before eager classification VS Code matches activation events as exact strings, so "* " and "onStartupFinished " are not startup activations. The parser read activationEvents through the whitespace-trimming ID helper, which turned those values into "*" and "onStartupFinished" and reported them as eager. Read activation events with a literal helper that drops only empty strings and exact duplicates, and cover the padded values next to their exact-name controls. * fix(vsix): keep mode-executable members inventoried when unread A member with no recognized suffix but Unix execute bits was only classified after its magic was read. When the hash budget, the package decode budget, encryption, or traversal skipped that read, it stayed unknown and fell out of interesting_members and the executable count. Unread mode-executable members now keep an inferred executable kind. * fix(vsix): count a singleton contributes.commands object VS Code accepts contributes.commands as one command object as well as an array. Normalize the singleton form before capping and counting so a package with one command reports commands_total 1 and the commands key count matches. * fix(vsix): keep contributed command identifiers literal VS Code registers and invokes a contributed command by its exact identifier, and the parser already keeps onCommand activation events literal. Commands went through the trimming text helper, so a declared "demo.run " was reported as "demo.run" next to an "onCommand:demo.run " event, giving two different identities for the same command. Keep the declared command text as written and report null only for an empty string. Titles are display text and stay trimmed. * fix(vsix): do not infer executables from symlink modes A Unix symlink entry carries 0o120777, so its permission bits made an unread link look like an executable helper. Only regular files, or entries with no recorded file type, now count toward mode-inferred executables. * style(vsix): apply oxfmt to manifest limit guard * fix(vsix): keep mode-executable kind when read bytes have no known magic A suffixless regular Unix member with execute bits but no recognized magic (for example a shell helper without a shebang) was listed as an executable only when the hash budget skipped its read. Raising the budget enough to hash it resolved the kind to unknown and dropped it from interesting_members and the executable count. Fall back to the mode-derived executable kind when the read bytes match no magic. * fix(vsix): charge failed member expansions to the package budget A member whose ZIP header understates its uncompressed size can decode its whole allowance before the bounded writer refuses it. That work was not charged to the package-wide decode budget, so every later failing member got the same allowance again. Charge the allowance on a max_member_bytes failure so later members see the spent budget. * fix(vsix): bound JSON values before parsing manifests Both package.json readers called JSON.parse after a byte-only check, so a 16 MiB manifest of many tiny values could allocate far more memory than its text. A one-pass countJsonValues scan now runs first: an extension/package.json holding more than 1,048,576 values is refused with a fixed json_values parser allowance, and an over-allowance directory package.json is left unread with a limitation, so its index files are not used. * Address review feedback * fix(vsix): treat absolute directory package.json main as outside the package Node resolves a directory package main with path.resolve(dir, main), so an absolute main names a host file, never a package member. Report it as no main so the lookup falls back to index.* or reports the entry absent. * fix(vsix): tag escaped entry points instead of matching them as members A package.json main or browser that climbs out of extension/ was kept as an ordinary member path string. A traversal ZIP member with the same name (extension/../outside.js) is in the inventory, so the lookup reported the entry point present even though that member is never extracted. packageJsonEntryPath now returns a tagged resolved/escaped value. Escaped entry points skip the member, directory manifest and case-only lookups and are reported with present: false. * fix(vsix): decode directory package.json as UTF-8 like Node Node reads a nested package.json as UTF-8 only. A UTF-16 manifest fails with ERR_INVALID_PACKAGE_CONFIG, so report it malformed instead of transcoding it and marking main present. * fix(vsix): keep directory package.json main inside the extension root A directory package.json main such as ../../outside.js could pop the extension segment and resolve to an archive-root member, which was then reported as the present main entry point. Treat any main that climbs out of extension/ as naming no main, so the lookup falls back to index.* or reports the entry absent. * fix(vsix): keep a root directory main from matching archive-root files A nested package.json main such as ".." in extension/out resolves to the extension root itself. Trying file suffixes on that path matched an archive-root extension.js, which sits outside the installed payload. Mark such a main directoryOnly and resolve it through extension/index.* only, as Node does. * fix(vsix): skip member reads once the package decode budget is spent A compressed member declaring zero uncompressed bytes passed the declared-size check even with no package allowance left, so its decoder still ran and produced output before the writer rejected it. The failure then charged zero, letting each later zero-declared member decompress again past the package ceiling. Skip the read and report the spent budget once nothing remains. * fix(vsix): keep declared API proposal names literal Read enabledApiProposals with the literal list reader used for activation events. VS Code matches proposal names exactly, so trimming whitespace or splitting on commas reported identifiers the package never declared and collapsed declarations that differ only in surrounding whitespace. * fix(vsix): select manifests by their exact member path Count ZIP members by exact logical path. A package holding only extension/Package.json no longer has it parsed as extension/package.json, and a case-only sibling no longer marks the real lowercase manifest as a duplicate and drops its facts. Names that differ only in case, and a manifest present only under another case, are reported as their own limitations. * fix(vsix): treat shared libraries as interesting members Bundled .dll, .so (including versioned .so.N names) and .dylib files without Unix execute bits were classified unknown, so their magic was never read and they were missing from interesting_members and the summary count. Classify these suffixes as executable so they are hashed and listed like .exe and .node members. * refactor(vsix): run inspection through the shared artifact runner VsixPackageService now delegates input parsing, the provider call, output checks, Evidence creation and late cancellation to executeArtifactInspection, as NugetNupkgService does, keeping only the VSIX-specific report checks. * feat(vsix): point first-contact inspection of a .vsix to the VSIX reader inspect_artifact now suggests inspect_vsix_package when a ZIP holds a root extension.vsixmanifest file. The non-ZIP refusal test follows main's unsupported_target classification for malformed target bytes. * fix(vsix): align artifact failures with main * fix(vsix): bound inspect_vsix_package output with shared detail/summary contract * Address review feedback * fix(vsix): bound summary text fields and report structured parameter limits * fix(vsix): omit required_value on early-stop parameter limits * refactor(vsix): count eager activation events without intermediate array --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
6a6e7b0bbf |
feat(artifacts): inventory OCI image layouts offline (#12470)
* feat(artifacts): inventory OCI image layouts offline
OCI image-layout directories (oci-layout, index.json, blobs/) arrive as evidence and previously required walking the JSON by hand.
This adds inspect_oci_image_layout / inspect-oci-image-layout for the directory form only. It reports layout version, nested indexes, image config facts, layers, and streamed SHA-256 (and SHA-512 when declared) verification of present referenced blobs. Env values stay omitted unless include_env_values is selected. Missing blobs, digest and size mismatches, unreferenced blobs, unknown media types, unsupported digest algorithms, and symlink blobs are findings. Layer contents are not decompressed.
* fix(oci): preserve whitespace in image config strings
Keep config facts such as WorkingDir exactly as written instead of
returning their trimmed form. Blank values still count as absent.
* fix(oci): read the platform os.version member
The OCI image index stores a platform version under the literal
"os.version" member, so Windows entries that share OS and architecture
keep the build that tells them apart.
* fix(oci): keep config Env values unless the caller omits them
Env values are bytes from the selected image, and AGENTS.md asks to
preserve local evidence without inferring secrecy from names. The
include_env_values control now defaults to true; false still leaves each
value null and keeps the names.
* fix(oci): report descriptors the parser cannot model
An index, layer or config descriptor without a string mediaType or digest
was dropped with no diagnostic, so an index of only malformed descriptors
read as an empty, fully covered index. Each such descriptor now records a
malformed_blob_json finding naming its position, what it lacks and any
digest it carries.
* fix(oci): walk nested indexes breadth-first
The index walk was depth-first with a visited set that ignored depth, so
an index shared between a nested path and the root was first visited too
deep, and what it reached within max_index_depth was never inventoried.
Indexes now queue breadth-first, so each is first reached at the
shallowest depth any path gives it.
* fix(oci): check every declared size of a shared blob
When several descriptors referenced one blob with different sizes,
remember kept only the first declaration, so a wrong later size was
never checked. Each referenced blob now keeps every distinct declared
size, and the file-size and hashed-byte checks run against each one.
* fix(oci): report partial coverage when referenced JSON is not read
A referenced index, manifest or config that was a symlink, or otherwise
could not be read, left its facts unexamined while coverage still read
complete. Any skipped referenced JSON read now makes coverage partial,
whatever finding explains it.
* fix(oci): report unsupported layer digests without calling them missing
A layer whose digest used an unsupported algorithm got no finding and
was recorded as a missing blob, even when its file existed, and coverage
could read complete. Every referenced digest with an unsupported
algorithm now records unsupported_digest_algorithm, its blob record
reflects the file at blobs/<algorithm>/<encoded>, and such a finding
makes coverage partial.
* fix(oci): keep the parse outcome when reader cleanup fails
The provider's finally replaced the parse result with a cleanup failure
that always claimed the parse completed, so a refusal, cancellation or
integrity failure and its layout snapshot were lost when closing the
reader also failed. The parse outcome is now captured first; a failed
parse stays the primary error, with its partial facts, and the cleanup
failure is attached to it.
* Address review feedback
* fix(oci): keep oci-layout snapshot on missing imageLayoutVersion
Build the oci-layout file snapshot before checking imageLayoutVersion and
attach it to the refusal, so a readable oci-layout without a version still
reports its sha256 and byte count.
* fix(oci): keep directory traversal coverage in layout reports
parseOciImageLayout iterated the directory reader without an onCoverage
sink, so names the reader skipped (for example non-UTF-8 names on Linux)
left the report claiming complete coverage with no limitation. Collect
the traversal coverage, carry its limitations into the report, and let
unknown or partial traversal coverage override the findings-based status.
A reader that reports nothing is treated as unknown.
* fix(oci): keep reader failures on referenced blobs
A referenced index, manifest or config read that failed in the reader,
for example a close failure after the JSON was fully read, was recorded
as malformed_blob_json and the call carried on. Only format failures
become findings now; reader failures reach the caller with their own
facts.
* fix(oci): budget decoded descriptors separately from directory entries
max_entries bounds the directory walk, but index, manifest and layer
descriptors also spent it, so many manifests sharing layers were refused
far inside the advertised directory budget. Decoded descriptors now spend
their own max_descriptors allowance (default 65536, maximum 1048576), and
a refusal names that allowance.
* fix(oci): keep the completed inventory when reader cleanup fails
When parsing finished but closing the directory reader failed, the
provider threw a cleanup failure built against a placeholder outcome and
the completed inventory was dropped. The cleanup failure now carries the
completed report as unretained Evidence in its partial observation, the
same way DesktopApplicationReader keeps its report. A provider test
covers that case and checks that a later close retries the failed
reader cleanup.
* fix(oci): keep reader omissions out of complete layout coverage
parseOciImageLayout took the directory reader's coverage but not its
omission callback, so a FIFO, socket or device node under blobs/ was
dropped from the blob inventory while the report still said complete.
Collect omissions other than the intentional skip of directories
outside blobs/, name the first one in a limitation, and report unknown
coverage when any were seen.
* refactor(oci): classify layout failures through classifyProviderFailure
The provider kept its own raw-error ladder in layoutFailure. Its OCI
decisions (unsupported root or symlink, parse limits with budget
recovery, format failures, reader failures) are now the recognise step
of a ProviderFailureDialect, with the io report as its unclassified
fallback, so typed failures pass through, cancelled reads use the shared
cancellation path, and a failed read's cleanup is bound by the shared
owner.
* fix(oci): match referenced blobs by resolved path
parseOciDigest accepts uppercase SHA-256 hex and resolves it to the
lowercase blob path, but the unreferenced-blob sweep keyed membership by
the descriptor's original spelling. A blob named that way was hashed as
referenced and also reported as unreferenced_blob with a second
referenced: false row. Track the resolved paths of referenced blobs and
skip them in the sweep.
* fix(oci): read shared configs once and budget expanded config facts
Each manifest reread and reparsed its config, and every image carried its
own copy of the facts, so many small manifests sharing a large config
could expand to far more memory than the per-file limits suggest before
the service checked the report.
Each config blob is now read and parsed once per layout and its facts are
reused. The config bytes behind each image spend a new max_config_bytes
allowance (default 64 MiB, maximum 512 MiB) before the image is added, so
a shared config counts once per image and an expansion past the budget
refuses the inspect and names that allowance.
* fix(oci): report blob sizes above 4 GiB
Descriptor, layer and blob sizes used the 32-bit count schema, so a
layout with a blob over 4 GiB produced a report the output schema
rejected, hiding its blob_oversize finding. Sizes now accept any
nonnegative safe integer; depth and coverage counts stay 32-bit.
* fix(oci): report a referenced layer that is not a regular file
A referenced layer whose blob path is a directory was recorded as kind
other with present false, but no finding was emitted. Layer blobs never
go through the referenced JSON reader, so coverage stayed complete even
though the layer was never verified. The layer now gets a missing_blob
finding, matching non-file indexes, manifests and configs, and coverage
is reported as partial.
* fix(oci): keep the oci-layout hash when a later budget refuses
A manifest or config past max_json_bytes, or a layout past
max_descriptors or max_config_bytes, threw a bare ParseFailureError
after oci-layout had been read and hashed. The provider only attaches
partial facts to OciImageLayoutRefusal, so that completed observation
was dropped.
The parser now rewraps any later ParseFailureError as an
OciImageLayoutRefusal carrying the oci-layout snapshot, so every
refusal after that point reports it as the partial observation.
* fix(oci): keep blobs unknown when the reference walk is truncated
When max_index_depth, an unreadable index or manifest, or a descriptor
that cannot be modeled stops the reference walk, blobs outside the
walked part were reported as unreferenced_blob. They may still be
reachable from what was not examined, so the parser now only asserts
unreferenced status after a complete walk and otherwise records a
limitation and leaves those blobs out of the inventory.
* fix(oci): report wrong-typed manifests and layers arrays
A non-array manifests member in index.json now refuses the layout and
keeps the oci-layout observation. A non-array manifests member in a
nested index, or a non-array layers member in a manifest, records a
malformed_blob_json finding and marks the reference graph truncated
instead of reading as an empty collection.
* fix(oci): report image configs whose root is not a JSON object
A config blob holding valid JSON such as [] or null fell back to empty
facts with no finding, so the report claimed complete coverage. Record a
malformed_blob_json finding for the config digest while keeping the
manifest and layer observations.
* fix(oci): decode only image config media types as JSON
A manifest whose config is application/octet-stream or another
non-image type no longer has its config run through the JSON decoder.
Valid binary config bytes produced a false malformed_blob_json finding,
and a config larger than max_json_bytes refused the whole inventory even
when it fit max_blob_bytes. Such configs now stay opaque references that
the blob pass hashes; the unknown_media_type finding is kept.
* fix(oci): bound JSON reads by the descriptor budget
The service checked json_bytes_read against one max_json_bytes document
per returned index and image plus two. A layout reads a manifest and a
config per image, and manifests or nested indexes that fail to parse are
read without appearing in the report, so valid layouts whose every
document fit max_json_bytes could be rejected after parsing.
Every nested index or manifest read is charged one descriptor and each
manifest reads at most one config, so bound the total by oci-layout,
index.json and two documents per allowed descriptor.
* fix(oci): count OCI 1.1 subject blobs as referenced
A manifest or index subject that names a blob present in the layout now
joins the referenced set, so the blob is hashed and is not reported as
unreferenced. A subject absent from the layout is allowed by the spec
and adds no finding. A subject that is not a descriptor is reported as
malformed and keeps unreferenced blobs unknown.
* fix(oci): keep caller selections in cleanup-recovered Evidence
When the reader fails to close after a completed inspection, the provider
keeps the inventory as partial Evidence built from the resolved input, so
its parameters named defaults the caller never chose and its Evidence ID
differed from the success path. Build both from one OCI Evidence helper
and have the service rebuild a recovered inventory from the caller's own
selections.
* fix(oci): keep blob rows when the reference graph walk is incomplete
When a nested index or manifest could not be read or exceeded
max_index_depth, every blob outside the walked part was dropped from the
report, losing its path, size and kind. List those blobs with a null
referenced status instead, and report unreferenced_blob only when the
whole graph was examined.
* fix(oci): report unknown media types on present subjects
A subject blob present in the layout now joins the referenced set, which
removed its unreferenced_blob finding. Index entries, layers and configs
also report an unfamiliar media type, but subjects skipped that check, so
an unknown subject format went unreported. A present subject with an
unknown media type now records unknown_media_type.
* perf(oci): index emitted blob findings instead of rescanning them
The blob inventory loop checked each referenced digest against the whole
findings array before recording missing_blob, symlink_blob, or
unsupported_digest_algorithm, which is quadratic for layouts with many
missing blobs. Index finding kind and digest in a set built once before
the loop so each check is constant time. Output is unchanged.
* fix(oci): report invalid descriptor sizes as malformed
An index entry, config, layer or subject descriptor whose required size
was missing, a string, negative or fractional became a null size, which
dropped it from size validation without any finding, so the report could
claim complete coverage. The descriptor still keeps its other facts, but
the defect is now recorded as malformed_blob_json on the owning blob.
* fix(oci): keep damaged config, subject and descriptor facts in the report
Image config parsing kept any string in rootfs.diff_ids, so a readable
config with diff_ids [""] produced output the schema rejects and the
service discarded the whole inventory as an AnalysisOutputError. Config
parsing now owns that boundary: diff_ids members that are not nonempty
strings, and empty ExposedPorts or Volumes keys, are omitted and reported
once per config blob as malformed_blob_json, and the manifest and layer
observations stay in the report.
Related gaps in the same walk:
- A present subject was hashed but never walked, so blobs it names were
reported as unreferenced. A subject manifest now goes through
walkManifest and a subject index joins the breadth-first index queue one
level below its owner, within max_index_depth.
- A manifest with no config member reported complete coverage. A missing
config is now treated like a malformed one.
- A symlinked referenced blob was not hashed but left coverage complete.
symlink_blob now makes coverage partial.
- An unusable descriptor size was serialized into the finding message.
It is now described by type and length, with short strings quoted.
- A reader failure after oci-layout was hashed dropped that observation.
It is now attached when the reader did not attach its own.
- Annotation and label names allowed by OCI, including the empty key,
failed the output schema. The name is now any string. The advertised
compact output schema summary is unchanged.
* perf(oci): index declared sizes for shared blobs
Recording a distinct declared size scanned every earlier declaration for
the same blob, so many references to one blob with distinct sizes cost
quadratic work inside max_descriptors. ReferencedBlob now keeps a Set
beside declaredSizes for membership, and the array keeps declaration order
for verification.
* fix(oci): walk subject manifests from a queue
Finish each manifest before reading the one its local subject names, so a
long subject chain no longer keeps every parsed document alive at once.
* fix(oci): resolve unsupported-digest layer presence at its layout path
A layer stored at blobs/sha1/<hex> was reported present: false because
the layer lookup only resolved verifiable digests, while the blob
inventory reported the same file present. Use the grammar-based path
fallback for layer presence too.
* fix(oci): keep reference coverage uncertain for opaque index entries
An index entry with an unknown media type is not walked, so the blobs
it references are unknown. Mark the reference graph truncated so no
blob is reported unreferenced, and report coverage as partial whenever
the reference graph was not fully examined.
* fix(oci): walk digest aliases that differ only in hex casing once
Descriptors whose digests differ only in accepted hex casing resolve to
one blob, but the index queue, visited set and config cache were keyed
by the source spelling, so each alias reread and rewalked the whole
index. Key traversal by the resolved blob path while descriptors keep
their source spelling in the report.
* fix(oci): keep unparsed digest spellings out of accepted traversal keys
A descriptor spelled blobs/sha256/<hex> did not parse, so its traversal
key fell back to the raw text, which matched the blob path key of the
accepted sha256:<hex> digest. Listed first, it marked the manifest
visited and the valid descriptor was skipped. Prefix accepted and
unparsed keys separately.
* fix(oci): bound index entry text retained across indexes
Index entries keep their digests, media types, platforms and annotations
in the report, but no allowance covered that text across indexes, so many
nested indexes with large annotations could exhaust memory within every
other limit. Charge each retained entry to a new max_descriptor_bytes
budget (64 MiB default, 512 MiB maximum) before adding it.
* fix(oci): hash each blob file once across digest spellings
Digest spellings that differ only in accepted hex casing resolve to one
blob path, but the blob pass hashed the file once per spelling. Cache the
hash result, or its oversize refusal, by blob path so each file is read
once, while every spelling keeps its own row, size checks and digest
check.
* fix(oci): report non-object config and rootfs subobjects
A present config or rootfs value that is not a JSON object now records a
malformed_blob_json defect instead of being replaced by an empty object, so
coverage reports partial. Other image facts are kept. Regenerate the
inspect_oci_image_layout advertised-schema summary.
* fix(oci): check declared sizes for unsupported-digest blobs
A blob referenced by a valid but unsupported digest (for example sha1)
skipped the declared-size checks and left observed_size null, even
though the directory reader already captured the file size. Record
observed_size and emit size_mismatch for it, still without hashing.
* fix(oci): keep reader integrity failures that wrap a JSON parse failure
readJsonDocument unwrapped any ArtifactReaderFailure whose cause was a
ParseFailureError. When a malformed referenced blob changed during
inspection, DirectoryArtifactReader.inspectFile raised an "integrity"
failure carrying that ParseFailureError, and the unwrap turned it back
into a malformed_blob_json finding. Only unwrap the plain "io" transport
wrapper with no cleanup lease, so integrity, cancelled and limit
failures keep their reader facts.
* fix(oci): report malformed config leaf fields
A config with Env: "A=1" or Cmd: ["/bin/sh", false] used to come back
as env: [] or cmd: null with no finding, indistinguishable from an
image that declared neither. parseConfig now checks each present known
field (the top-level strings, User, Env, Entrypoint, Cmd, WorkingDir,
ExposedPorts, Volumes, Labels, StopSignal) and records
malformed_blob_json for a wrong type, keeping the other facts. Env
members that are not a named string and non-string label values are
omitted and counted. null stays an omitted declaration.
* fix(oci): allow json_bytes_read beyond 32 bits
coverage.json_bytes_read sums bytes across every JSON document read.
OciImageLayoutService bounds it by max_json_bytes * (2 + 2 *
max_descriptors), which at a 16 MiB per-document cap passes 0xffffffff
well within budget, so the uint schema made safeParse reject a completed
report as AnalysisOutputError. Give the counter a nonnegative safe-integer
schema; the other uint counters are unchanged.
* fix(oci): report malformed image history
A non-array history or a history member that is not an object was
silently dropped, so damaged build history looked the same as omitted
history. Report both as malformed_blob_json defects on the config blob
and keep the readable history records and other image facts.
* fix(oci): report damaged descriptor metadata and symlinked blob dirs
Descriptor platform and annotations that were present but malformed
(platform: [], a non-string platform field, annotations that are not an
object or hold non-string values) were normalized to null or [] with no
finding. Report each as a malformed_blob_json defect against the owning
document and keep the readable entries.
A symlink at blobs or blobs/<algorithm> is not followed, but nothing
recorded the skipped tree, so an empty index over a linked blob
directory reported an empty inventory with complete coverage. Record a
symlink_blob finding for the linked directory so coverage is partial.
* Address review feedback
* Address review feedback
* Address review feedback
* Bound repeated JSON member names in OCI findings
A long duplicate member name is now described by its length instead of
being copied into the finding message.
* fix(oci): keep the oci-layout hash when its JSON is malformed
The oci-layout file is now read and hashed first, and its observation is
recorded before decoding. An oci-layout with invalid UTF-8, invalid JSON
or a duplicate member is refused with its completed file identity.
* fix(oci): charge accepted descriptor text to max_descriptor_bytes
Accepted subject, config and layer descriptors keep their digest and
media type in image rows, the reference map, findings and blob rows, but
only index entries and rejected descriptors spent max_descriptor_bytes.
A layout with many manifests carrying long distinct layer digests could
retain unbounded text. Charge accepted descriptor text before retaining
it, once per referencing manifest or index.
* fix(oci): report presence defects for unsupported-digest blobs
A referenced blob with an unsupported digest algorithm whose layout path
is missing, a symlink, or not a regular file now gets the same
missing_blob or symlink_blob finding a supported digest gets, alongside
unsupported_digest_algorithm. Present files still only get the size
check and stay non-missing.
* perf(oci): drain index and manifest queues with a cursor
shift() relocates the remaining queue on every step, which makes draining
layouts with many index references quadratic. Walk both breadth-first
queues with an index cursor instead.
* fix(oci): keep blobs under a symlinked blob directory unexamined
When blobs or blobs/<algorithm> is a symlink, the reader lists the link
but never its children, so a referenced blob under it is absent from the
listing without being absent from the layout. One shared lookup now
tells listed, unexamined and confirmed-missing paths apart for the
reference walk, subjects, and both inventory branches. An unexamined
blob gets a symlink_blob finding naming the directory instead of
missing_blob, and an unexamined subject marks the reference graph
truncated.
* fix(oci): charge serialized config facts to max_config_bytes
The config allowance counted the config document's source bytes, but each
image carries the parsed facts, and a sparse history entry such as {}
expands into a record with four null fields. A small shared config with
thousands of empty history entries could pass the budget while the report
grew past the runtime's string limit. Each distinct config now charges the
exact compact JSON size of its facts, once per image that uses it.
* fix(oci): keep the oci-layout snapshot when its read fails to finalize
When the oci-layout read completes but closing its descriptor fails, or
cancellation arrives during the close, the reader rejects before the
parser records the layout hash. The reader keeps the completed bytes on
that failure, so the failure reached translation without the SHA-256 and
byte count it could have carried, unlike the same failure on index.json.
The parser now records the completed layout observation from that outcome
and rethrows the reader's failure unchanged, keeping its cleanup owner.
* fix(oci): keep reference status unknown under an unwalked present subject
A present subject with an unknown media type, or an index or manifest
subject whose digest algorithm is unsupported, is not read, so the blobs
it names were reported as unreferenced with complete coverage. Mark the
reference graph truncated in both cases so unmatched blobs keep an
unknown referenced status.
* fix(oci): keep a malformed index.json primary when its handle close fails
When index.json is malformed and closing its descriptor also fails, the
directory reader raises ArtifactFileCleanupFailure with reason io and keeps
the ParseFailureError as the physical outcome. The OCI dialect translated
the wrapper directly, so the malformed input surfaced as an I/O failure even
after the resource scope retried the close.
The dialect now supplies readCleanup: the shared classifier classifies the
failed outcome as primary, and the unresolved close is attached beside it
and bound to that read's exact cleanup lease. A cleanup-only read keeps its
previous projection.
* fix(oci): count a malformed blob's bytes in json_bytes_read
A referenced index, manifest or config that was read in full but failed
UTF-8, JSON or duplicate-member decoding became a malformed_blob_json
finding, yet its bytes never reached json_bytes_read, because the count
was added only after decoding succeeded.
The blob read now adds the byte count inside the completed read, before
decoding, so coverage reports every byte the parser examined.
* fix(oci): report a missing or non-directory-ancestor path as invalid input
A selected root that resolves to ENOENT or ENOTDIR is a bad path, not an
I/O failure. Classify it as an AnalysisInputError on `path` before the
generic reader translation; other root I/O keeps its execution failure.
* fix(oci): keep the layout hash when index.json close also fails
When malformed index.json also failed to close, readCleanup composed the
error from the classified parse failure, which carries no observation,
so the completed oci-layout hash was dropped. Carry the read's partial
observation onto the primary before composing.
The close-fault test now selects the index.json handle by file identity
(dev and inode) rather than the second close call, and asserts the
fault landed there and the oci-layout hash survived.
* fix(oci): report malformed subject digests and count examined entries
A subject whose digest is not a valid OCI digest has no layout path, so
the walk returned without a finding and kept claiming it could prove
which blobs nothing references. It now records a malformed_blob_json
finding on the owner and marks the reference graph truncated, the same
as any other subject descriptor it cannot model. An absent subject with
a well-formed digest stays finding-free.
coverage.entries_examined counted only the entries the reader yielded.
It now takes the reader's examinedEntries from onCoverage, which
includes names the reader examined but omitted, and falls back to the
yielded count when the reader does not report one. An omission that
rewrites the traversal coverage keeps that count.
* fix(oci): keep the root index out of the blob traversal namespace
The root index was walked and prequeued under the traversal key of its
SHA-256 digest, which is the key of the blob path blobs/sha256/<hex>.
When a damaged nested index named that digest and the blob file there
held different index JSON, the queue skipped the blob as already walked,
so its manifests, configs and layers were never read and were reported
as unreferenced under complete coverage.
index.json now walks under its own traversal identity. A descriptor that
names its digest reads and walks the blob stored at that path like any
other nested index.
* fix(oci): diagnose conflicting media types inside referenced JSON
A referenced manifest or nested index may repeat its media type in its
own optional mediaType member. The walk ignored that declaration, so a
document admitted as a manifest but declaring the index type, or an
unknown type, produced no finding.
Check a present declaration against the descriptor type the walk
admitted it under. An unknown declared type is reported as
unknown_media_type; a known but conflicting type or a non-string value
is reported as malformed_blob_json. The members are still read, so the
other readable facts are kept, and an omitted mediaType stays valid.
The root index.json is admitted under its own declaration and is not
checked against itself.
* fix(oci): charge unknown declared media types to max_descriptor_bytes
A referenced manifest or nested index whose own mediaType is an unknown
string is quoted in an unknown_media_type finding. That text was retained
without spending the descriptor text budget, so many hash-valid documents
with long declarations could grow findings well past max_descriptor_bytes.
Charge the escaped declaration before the finding is recorded.
* fix(oci): mark the reference graph incomplete on document-type conflicts
A referenced manifest or nested index whose own mediaType names another
document kind, or an unknown type, was diagnosed but its blobs were still
judged with a complete reference graph. The walker reads only the members
of the admitted kind, so members of the declared kind, such as an index's
manifests inside a document admitted as a manifest, were never followed
and the blobs they name were reported as unreferenced_blob.
Mark the reference graph truncated for an unknown declared type or one of
a different document kind, so unreached blobs keep an unknown referenced
status. The readable facts are still reported. A declaration of the same
kind, such as the Docker manifest type on an OCI manifest descriptor,
reads the same members and keeps unreferenced status definite.
* docs(oci): state that unsupported digest algorithms skip hashing
The guide said every present referenced blob gets a SHA-256. Blobs whose
digest uses an algorithm other than sha256 or sha512 are not hashed; their
row reports hashed: false with null sha256 and sha512. Document that and pin
the null hash fields in the sha1 layer test.
* fix(oci): check the root index.json mediaType against the index kind
The root index.json skipped declaration checking because no descriptor
names it, so its own mediaType chose the admitted type. A root that
declared the manifest type or an unknown type was still walked as an
index with a complete reference graph, and blobs named by members the
index walk never reads were reported as unreferenced_blob.
Admit the root as an index: an index declaration of either family
stands, and any other declaration is checked against the OCI index type
like a nested index, which diagnoses it and marks the graph incomplete.
Also document that unknown declared media types quoted in findings
spend max_descriptor_bytes.
* Address review feedback
* Address review feedback
* fix(oci): check each referencing media type against a revisited document
A manifest or nested index reached a second time was skipped before its
mediaType declaration was compared with the new descriptor type, so a
conflict was reported or not depending on descriptor order. Each document
now records its declaration on first decode, and every distinct media type
a later reference admits it under is checked against it.
* fix(oci): detach redacted Env names from their bindings
With include_env_values false, each retained Env name was a slice of the
whole NAME=value string, so a long value stayed alive while the config
fact budget charged only the name. Redacted names are now standalone
copies, and a heap regression test covers eight 0.9 MiB values.
* fix(oci): keep only string mediaType declarations for revisit checks
The revisit cache kept each decoded document's raw mediaType, so a layout
of many manifests with large object declarations held all of them for the
whole walk while no byte budget charged them. A non-string declaration is
rejected whatever it holds, so the cache now keeps null in its place and
still reports it as not a string on each new referencing media type.
* Address review feedback
* Address review feedback
* Address review feedback
* fix(oci): preserve layout evidence on malformed targets
* Address review feedback
* fix(oci): diagnose schema versions and charge annotation records
Indexes and manifests whose schemaVersion is omitted, not a number, or a
number other than 2 now get a malformed_blob_json finding and partial
coverage, while their entries, config and layers stay readable.
Index entry annotations now spend max_descriptor_bytes as each
{name, value} record is built, charged at its serialized size, so many
short or empty annotations can no longer retain far more than their text
was charged for.
* docs(oci): describe annotation record accounting for max_descriptor_bytes
* Address review feedback
* fix(oci): wire summary delivery, parameter budget limits, and single-pass annotation parsing
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
|
||
|
|
68e1ec3e36 |
fix(package): declare the projected manifest scripts without prepare
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
30c87211f3 |
fix(package): leave the source-checkout prepare script out of the published manifest
The published manifest kept every development script, including prepare, which only patches release-please in a source checkout and does nothing in an installed package. npm 11 treats prepare as an install script, so "npm install -g rea-agents" warned that rea-agents has install scripts not covered by allowScripts and suggested allowing them. The staged package manifest now omits prepare. Installing the staged tarball with npm 11.19.1 lists only frida's own installer. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
4edb2c08ee |
fix(artifacts): explain ASAR PE signed-after-packing mismatches (#14702)
* fix(artifacts): explain ASAR PE signed-after-packing mismatches When an unpacked PE companion fails ASAR integrity only because Authenticode was applied after packing, record a verifiable signing_explanation on the SHA-256 contradiction and error details instead of an opaque untrusted mismatch. Bytes stay observed-untrusted; any other mutation remains an unexplained contradiction. Fixes #7212 * fix(artifacts): address signed-after-packing Greptile review Catch ParseFailureError so unreadable PKCS#7 keeps the digest explanation, share WIN_CERTIFICATE structural walks, index signer lookups, charge optional reads to acquisition budgets with reported skips, preserve mismatch details through cleanup failures, and inherit the shared MCP test deadline. * fix(pe): walk WIN_CERTIFICATE entries lazily under max_entries Convert the certificate-table walker into a generator so inspection stops at the entry budget without materializing every range, and reconstruction can validate structure with constant memory. |
||
|
|
42ce0ea231 |
feat(browser)!: budget observe_web_execution delivery
observe_web_execution returned complete script sources inline. On a local page loading rxjs, openpgp and isomorphic-git in Chromium 156, the complete observation was 1,888,024 bytes of structured content, nearly all source text. observe_web_execution now takes detail and joins the agent result budget. Omitted, an observation that fits delivery.agent_result_budget_bytes is inline and a larger one is retained behind its summary, which pages through the web-execution view. On that page the default reply was 7,458 bytes. detail summary retains the observation through the shared retained summary binding. rea observe-web-execution uses the shared CLI Evidence delivery. The real-browser verifiers request the complete observation they assert on. BREAKING CHANGE: an observe_web_execution call that omits detail on an observation above the agent result budget now returns the retained summary. Pass detail: "complete" (--detail complete) for the previous shape. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
d9b449d39c | refactor(verify): share canonical output schema assertions (#14640) | ||
|
|
a156d20516 | refactor(verify): share Ghidra installation prerequisites (#14569) | ||
|
|
3d9ceeae6b | refactor(resources): share the retained close-owner adapter (#14562) | ||
|
|
0bbdbeaedf | refactor(cli): share compiled runtime checks with the session worker (#14557) | ||
|
|
5bf09b6dff | refactor(ghidra): reuse the verifier file digest for fixture checks (#14554) | ||
|
|
41589492e0 |
refactor(ghidra): reuse the verifier MCP call binding (#14590)
* refactor(ghidra): reuse the verifier MCP call binding * test(ghidra): cover shared verifier call decoding |
||
|
|
aad3c9c45a | refactor(windows): reuse the verified package argument encoder (#14591) | ||
|
|
123b693f08 |
feat(delivery)!: bound default results by an agent result budget (#14252)
* feat(delivery)!: bound default results by an agent result budget Omitted detail now returns complete Evidence only when it fits the new delivery.agent_result_budget_bytes runtime setting (default 49152 compact JSON bytes, about 12k tokens at an estimated 4 bytes per token). Larger results are retained and delivered as the producer's summary with a limitation naming the budget and the recovery call; nothing is refused or truncated. inspect_analysis_view gains an evidence-json view that pages the exact JSON text of retained Evidence. The CLI applies the same budget and publishes the complete bundle with --evidence_output. inspect_managed_members type_names now also narrows member_refs and exported_types, and inspect-byte-entropy gains CLI evidence delivery. BREAKING CHANGE: An omitted detail no longer always returns complete Evidence inline on MCP or the CLI for tools with a detail selector (including inspect_managed_members, inspect_managed_artifact, inspect_byte_entropy, inspect_artifact, analyze_javascript_application, list_procedures, list_strings and the other operations listed in src/domain/agentBudgetOperations.ts). Over the budget they return the retained summary; pass detail complete (--detail complete) for complete inline delivery. inspect_managed_members type_names narrows member_refs and exported_types. Fixes #14172 Fixes #14180 Part of #14187 Part of #14156 * test(schemas): record advertised summaries for budgeted detail * fix(delivery): keep budgeted summaries canonical and carry delivery facts beside them Review fixes for the agent result budget: - Deliver the producer's own summary record, identical to detail summary, so its identity holds in summary consumers such as compare_artifacts. The budget, sizes, retention and the exact paging call travel as delivery facts: a second MCP text block and _meta, or a delivery field in CLI output. - Capture the caller's detail for application-validated tools too, so inspect_binary_layout and similar tools are budgeted. - Keep recovery facts when a budgeted summary itself exceeds the frame. - Size an omitted evidence-json limit by escaped UTF-8 bytes and never split a surrogate pair, even in a one-unit page. - Add the REA_AGENT_RESULT_BUDGET_BYTES launch seed; the shared test environment raises it for semantic tests, and budget tests clear it. - Align tool descriptions and verifiers that read complete Evidence. * fix(delivery): retain the budgeted summary like an explicit summary * fix(delivery): read the budget seed from the captured environment and count delivery facts in the frame - The agent result budget seed is read from the environment the server or CLI invocation captured: ToolResultDelivery takes it at construction, and a CLI invocation binds it in its publication context. The ambient process environment is no longer read. - The frame check reserves the bytes of the delivery block and _meta that are added after encoding, so a budgeted response cannot exceed the frame. - Conformance workflows that resend complete Evidence raise the budget through the shared inline-Evidence environment, as do the artifact and binary layout verifiers. * fix(delivery)!: request complete Evidence explicitly and never spill CLI overflow - Shared test and verifier environments no longer raise the agent result budget. Every test and verifier workflow that reads complete Evidence from a budgeted tool now requests it with detail complete or --detail complete, including the real-provider verifiers outside PR CI (Ghidra, Hopper, IDA, Kuna and client verifiers). Default delivery is exercised as shipped. - Budgeting applies only to tools with a detail selector, so every budgeted call has a complete opt-out. - CLI overflow without --evidence_output writes nothing; its delivery facts carry exact rerun argv for --detail complete and --evidence_output, omitted when the command declares sensitive values. * test(delivery): prove captured budget seeds with valid in-range values * test: state complete-detail requests once and fix codemod regressions - Add tests/support/completeDetail.ts with COMPLETE_DETAIL and completeArguments so tests that read complete Evidence request it in one place, keeping functions within max-lines-per-function without raising the limit. - Restore provider-client tests (GhidraClient, Hopper health): their callTool("name", ...) calls are bridge requests, not MCP tools, and take no detail. - Update the game-scale type inventory test for member_refs narrowing. * test: request complete Evidence in shared JavaScript analysis helpers and remaining CLI workflows * test: request complete Evidence by default in the shared test transports The shared MCP client helpers (createTestMcp, connectLocalToolsMcp and the CLI fixture's shared MCP session) and the CLI runners (the cli fixture and the shared CLI session) now apply one named default, completeEvidenceByDefault. A budgeted tool called with neither detail nor view gets detail complete; the CLI does the same with --detail complete, chosen by the command's tool contract. A budgeted operation that resolves to no contract fails loudly at load. Tests whose subject is delivery opt out with delivery "budgeted". This is a test-harness choice; production delivery is unchanged and the budget tests prove the default path. Per-call complete-detail edits are reverted in the 204 test files whose transports all apply the default. Explicit requests remain where a test drives its own SDK client, server, CLI instance or process, and where the detail choice is the test's subject. * test: resolve CLI complete-detail defaults from the CLI registry The Real Apple and browser verifiers read complete Evidence through artifactCliEvidence, which ran the compiled CLI without a detail choice and got the budgeted {summary, delivery} output. The helper now requests complete Evidence for commands that take --detail, read from the compiled CLI's own registry (scripts/lib/complete-evidence-cli.mjs). The test harness default had a sibling bug: it treated every cli-flagged budgeted contract as taking --detail, but only Evidence-delivery commands do (inspect-binary-layout does not). It now reads the source CLI registry too, and covers every command the CLI budgets. * test(verifiers): request complete Evidence at each verifier's SDK client and CLI argv The real-browser failure was the same missing normalized_result as the Apple one: browser-capture-metadata-budget-e2e reads analyze-web-bundle through artifactCliEvidence, fixed in the previous commit. The shared verifier module, scripts/lib/complete-evidence.mjs, now owns both transports: - completeEvidenceClient wraps each verifier's SDK Client once, so every callTool to a budgeted tool with neither detail nor view requests complete Evidence, whatever local call helper a verifier uses (86 clients, including the Ghidra, Hopper, IDA and Kuna verifiers' argument-less list_procedures and inspect_native_load_image calls). - completeEvidenceCliArguments covers the remaining verifier CLI argv that chose no detail, such as function, decompile, analyze and the Android and Apple commands. Commands and tools that are not budgeted are sent as written. * test(delivery): await async completeEvidenceCliArguments helper in boundary test * test(delivery): request complete detail in Electron CLI artifact format test * docs(delivery): document delivery.rerun as add-only argument arrays * test(schemas): record advertised summaries for the unified delivery budget Tool descriptions now name the agent result budget, and the evidence-json default page is derived from the 32 KiB default, which changes the advertised input digests of the 28 affected tools. Recorded from the Build package job's output. * test(delivery): pin the budget boundary and keep failures unbudgeted Main's retainedSummaryDelivery tests pinned the size decision at exactly 32,768 and 32,769 UTF-8 JSON bytes. Unifying that decision into budgetedSummaryBytes deleted them, and their port never landed, so the byte measurement went unchecked. Restore them against budgetedSummaryBytes at the configured budget and one byte over, for the default and a runtime budget, with ASCII, escaped and multibyte text, plus each condition of the decision. Off-by-one mutants (< for <=, a cap one byte short) fail six cases; measuring UTF-16 code units instead of UTF-8 bytes fails the multibyte cases. An MCP case pins that a target failure from a budgeted tool under the minimum budget is identical with detail omitted and complete, with no delivery facts. * test(verifiers): route literal CLI argv for budgeted commands through complete Evidence real-browser failed with "Scenario CLI did not report external disconnect ownership": runScenarioCli ran capture-browser-scenario without --detail, so an over-budget capture came back as its summary, which has no browser.cleanup. The earlier sweep counted these files as covered because their MCP clients were wrapped, but their CLI argv was not. Route the shared runScenarioCli helper (five callers), the local cli helpers in the module, source-map and script-export verifiers, and every other literal argv for a budgeted CLI command without --detail or --view (EVM interface, binary layout, packet capture, devicetree, DOM destinations, Ghidra relocation symbols, WABT cleanup, Termux browser) through completeEvidenceCliArguments. A sweep of scripts/ for budgeted command literals with --json and no detail selection now finds none. * fix(verifiers): leave clients without callTool unwrapped The native verifier cleanup test drives native-value-e2e with a connection double whose Client has only connect and close. completeEvidenceClient bound client.callTool unconditionally, so wrapping threw a TypeError before connect ran. That TypeError replaced the primary connection failure the test asserts is preserved, and all four fault cases failed in Test shard 5 and Portable tests. A client without callTool has no tool call to complete, so the helper now returns it unchanged. Locally all five fault modes of the fixture now exit 0. * fix(delivery): keep the catalog recorder on shipped helpers and expect view-implied summary The verifier sweep wrapped record-mcp-catalog.mjs in completeEvidenceClient, which lives in an unshipped helper. deferredRuntime copies only the package's shipped files plus the recorder, so the recorder failed to load (ERR_MODULE_NOT_FOUND) and its cleanup recorder never wrote. The recorder only lists tools and prompts, so the wrapper had no effect; it is removed. This branch makes a view with no --detail select summary delivery, as MCP does for a view. Three CLI cases still expected the old view refusal; with a view alone the missing input is now the summary bundle, so they expect evidence_output, and a view with --detail complete still refuses the view. * fix(delivery): request complete Evidence where callers need the whole result Budgeted delivery made four callers receive a summary they cannot use: - The GitHub Actions example uploads the analysis as a CI artifact, so it now asks for --detail complete; over budget it had saved a summary. - javascriptIntegrityPolicyCli spawns the CLI itself, outside the test harness default, and reads normalized_result; it now applies the same completeEvidenceCliArguments default. - nativeObservationViewsMcp builds its own client to prove complete observations overflow into a paging continuation; it now applies the harness default so each call asks for complete Evidence. - The CLI parity goldens are re-recorded for the --detail and --evidence_output options the budgeted commands now advertise. * fix(tests): give processes tests spawn the largest agent result budget About 90 tests spawn scripts/rea.mjs or a server directly, outside the harness default that asks for complete Evidence, and read analysis facts from the result. Over the default budget they received a summary instead; javascriptChildHandleOwnership failed this way. The Vitest environment now seeds REA_AGENT_RESULT_BUDGET_BYTES with the largest accepted value, so a spawned CLI or server delivers complete Evidence, as the in-process default does. Delivery tests keep their own budget: agentResultBudgetMcp builds its server without the seed, so its default-budget cases still exercise the shipped default. * fix(tests): give budgeted harness tests the shipped agent result budget The test environment seeds the largest agent result budget so spawned processes deliver complete Evidence. In-memory servers built by createApplicationMcpHarness (and connectGhidraMcp, which uses it) inherit process.env too, so a test that chose testDelivery "budgeted" kept the seed: the 600-row list_procedures case and the omitted-detail web page views returned complete Evidence instead of a summary. testDeliveryEnvironment now owns that choice: a budgeted test's server environment drops the seed and uses the shipped default. The application harness applies it to every server it builds. * fix(tests): expect view-implied summary delivery in the Playwright trace refusal A view with no --detail now selects summary delivery, so its refusal names the missing evidence_output bundle; --detail complete still refuses the view. The trace test still expected a view refusal in both cases. |
||
|
|
150d6f0e19 | refactor(verifiers): share legacy Ghidra snapshot construction (#14566) | ||
|
|
60af9ef6b3 |
refactor(verifiers): share whole-file SHA-256 hashing (#14475)
* refactor(verifiers): share whole-file SHA-256 hashing * fix(verifiers): type the streamed digest input |
||
|
|
a61ff39c9a |
fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures (#14268)
* feat(errors)!: add the TargetFailure model, its projection table and conformance registry Introduce one domain-owned TargetFailure value whose kind alone derives the public code, category, retryability, recovery and details, for CLI and MCP alike. Selected-file malformed and truncated refusals are the first area on it: AnalysisMalformedTargetError is replaced by AnalysisTargetFailureError, and ParseFailure's byte-structure variants are TargetFailure variants rather than a parallel type. The shared stableArtifactParserFailureCli loop is replaced by a declarative registry (tests/support/targetFailure/readers/*.ts) and one generated suite that runs every registered case through the CLI and MCP. BREAKING CHANGE: selected-file malformed and truncated refusals add details.failure_kind, and a truncated target's remediation now says to re-acquire the complete file instead of choosing another target. Codes are unchanged. Affected operations: every operation that refuses a selected file's malformed or truncated bytes, including the ELF, PE, Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel module, binary hardening, managed PE/CLI and IL2CPP readers. * test(managed): name the target failure error in the merged status test * docs(reference): name the error CSV instead of linking a non-page file * fix(tests): expect the path reason for non-regular dyld inputs #14225 refuses a non-regular dyld input as ArtifactReaderFailure("path"); dylibFileLifetime still expected "format" and fails on main's shard 9. * fix(tests): expect io, invariant and path where #14225 reclassified stableArtifact expected "format" for an impossible descriptor byte count (now io) and an invalid chunk size (now InternalInvariantError); directoryArtifactReaderOpen expected "format" for a non-file entry (now path, the same change as #14238). All three fail on main. * fix(errors)!: raise container reader byte faults as malformed or truncated targets Delete the ambiguous `format` reason from ArtifactReaderFailure and ArtifactOperationError. Each container reader now raises its owner's fact once, through malformedArtifact / truncatedArtifact, with format, offset, field and measured extents. Short reads inside a measured extent are read-coverage integrity failures, path-kind refusals are `path`, foreign or recovery-requiring inputs are `unsupported`, host tool output is `io`, and REA defects are InternalInvariantError. The trace, NTFS journal, release exposure, web capture, native macOS and web artifact adapters project the reader's parsed facts as AnalysisTargetFailureError instead of invalid_request. Inventory malformed, truncated, unsupported and cancelled reasons take their code from the TargetFailure projection table, so a truncated container is unsupported_target with failure_kind "truncated" on both paths. BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact, analyze_javascript_application, inspect_desktop_application, inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg, trace_dylib_resolution, trace_web_module_imports and trace_web_source_location report damaged container bytes as unsupported_target (details.reason "malformed" or "truncated", with failure_kind and format) instead of artifact_operation_failed with reason "format", and a truncated container as unsupported_target instead of truncated. inspect_playwright_trace, inspect_ntfs_journal, audit_release_exposure, the web capture inspection operations and the caller-selected import and source maps report damaged selected bytes as unsupported_target instead of invalid_request. The `format` reason no longer appears in details.reason. * test(artifacts): expect target failure codes in compiled CLI and MCP suites * fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures The SQLite engine's `format` reason is renamed to `malformed` at its owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an AnalysisTargetFailureError at the selected path with format "sqlite". The pwntools and EVM worker replies keep their wire reason "format", which their workers define, and the adapters translate it once into a malformed target failure with the profile's format (elf, elf-core, evm-bytecode) instead of an invalid_format argument issue. SQLite joins the target-failure conformance registry. BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout, inspect_recorded_crash and inspect_evm_interface report a selected file's malformed bytes as unsupported_target with details.failure_kind "malformed", format_failure, format and path, instead of invalid_request with an invalid_format issue on path. * fix(errors): give the integrity kind a schema-valid code and list the reference page artifact_integrity_mismatch's projection schema requires declared and calculated digests, which a TargetFailure of kind integrity does not carry, so the kind now projects artifact_operation_failed with category integrity_mismatch. The model test validates every kind's projection against analysisErrorProjectionSchema. The reference page joins the documentation sidebar. * fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local A Bun or Node SEA short read inside a range already checked against the measured size meant the file changed, not that it was truncated. The carrier range reader and Bun's readExact now raise read-coverage integrity for it, and keep 'outside the file' as the truncated case. DesktopFileInspection records an unsupported managed-metadata probe as a row issue again, so later file checks still run. * test(errors): expect target failure facts in the pwntools and EVM reply suites The literal-replacement scenario now reads the failure's detail instead of an issues[] message, and a malformed reply wrapped by cleanup failure reports category unsupported_target. * test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit signatures) and the truncated Apple IPS body move into the conformance registry, which runs them through the CLI and MCP and now also checks that a refusal leaves the selected file unchanged. The per-command tests keep only their valid-image controls. * test(sqlite): drop the malformed-database provider test the conformance registry covers inspect_sqlite_database/not-a-database in the target-failure registry runs the same non-SQLite bytes through the CLI and MCP, asserts the malformed target facts and checks the selected file is unchanged. * feat(errors)!: make failure_kind the identifier and derive code and retry from it Apply the owner review on #14239 to the TargetFailure model: - remove details.format_failure; failure_kind is the only identifier; - give integrity, conflict and io their own codes (target_integrity_mismatch, input_conflict, host_io_failed) and derive inventory malformed, truncated and unsupported codes from the same table; - add a retry hint (none, backoff, after_change) derived from the kind, with io refined by its transient errno fact; retryable stays the unchanged-retry flag and is true exactly for backoff; - rename the limit-cut result code and category truncated to partial; - drop cancelled and resource from the target kinds and spell identifiers in American English (unrecognized); - return a target failure a tool handler throws as a projected isError result instead of letting the SDK flatten it to text. BREAKING CHANGE: details.format_failure is removed (read details.failure_kind). The truncated result code and category are now partial. Target integrity failures report target_integrity_mismatch, host read failures host_io_failed and disagreeing inputs input_conflict. Inventory operations (inventory_artifact, inspect_artifact, extract_artifact and the other inventory callers) report truncated container bytes as unsupported_target. Every target failure carries a top-level retry hint. * test(sqlite): expect a malformed target for non-database bytes in the CLI suite * fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart PyInstaller reads inside the measured size, and .NET bundle manifest refills, now raise read-coverage integrity on a zero-byte read instead of truncated. A .NET bundle field and a Godot PCK directory entry that extend past the file are truncated (with offset and extents) instead of malformed. An absent or invalid ASAR packed offset is malformed; only a valid range past the archive is truncated. The .NET manifest string offset is reported in file coordinates. * fix(pwntools): report a short ELF header as a truncated target The layout and recorded-crash workers raise a distinct truncated reason when the file ends inside the ELF identification or header, and the decoder projects it as failure_kind truncated instead of inferring it from the message. * fix(artifacts): verify the carrier before blaming a short read on the bytes The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and .NET bundle members now re-verify the source before reporting a short stream as malformed, so a file that changed during the read reports the change. The truncation site builds the model's measured extent. * docs(android): name unsupported_target for truncated boot image structures * fix(errors)!: report a target that changed during the read as failure_kind changed Inventory integrity failures whose check means the target moved under the read (container, member and unpacked-entry identity, read coverage, traversal coverage) now take the model's changed projection: code artifact_changed, retry backoff and details.failure_kind changed. A selected target that no longer matches the one the session admitted gets its own admitted-identity check and keeps its reopen recovery. BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and the other inventory operations report a target that changed during the read as artifact_changed (retryable, failure_kind changed) instead of artifact_operation_failed. Admission-identity refusals report integrity_check admitted-identity instead of container-identity. * test(artifacts): expect admitted-identity for selections replaced before admission A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split. * test(go): name the fixture and result when an MZ carrier is not refused through MCP * test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input. * test(web): expect the partial code for a refused source-map admission The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling. * test(errors): check the MCP target failure as the text clients receive The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead. * test(artifacts): expect artifact_changed when selected bytes change after inventory Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed. * fix(errors): report a session digest mismatch as admitted-identity The digest the session admitted does not change when the same request is repeated, so targetDigestChangedFailure was inviting a backoff retry that fails the same way. It now names admitted-identity, which stays artifact_operation_failed and not retryable, and tells the caller to reopen. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(artifacts): classify unused PyInstaller compressed input as layout zlib stops at the first complete stream, so a declared span that arrives intact but is not fully consumed is trailing junk or a second stream, not a file that changed. A source that ends before that span stays read-coverage. The cached-carrier test replaces the file with a different size so a shared timestamp cannot hide the rewrite. Co-authored-by: morluto <morluto@users.noreply.github.com> * test(applications): expect unsupported_target for a damaged trace stream A trace member whose CRC fails is a malformed zip target. The partial Evidence assertion now checks that code, failure_kind and format. Co-authored-by: morluto <morluto@users.noreply.github.com> * test(dylib): expect admitted-identity when the opened target is replaced The session keeps the digest it admitted, so replacing the executable and repeating trace_dylib_resolution is not a retryable container change. Co-authored-by: morluto <morluto@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com> |
||
|
|
a9e34a4aae | fix(ci): bound browser runtime fixture source readiness (#14364) | ||
|
|
a85859e147 |
feat(pe): inspect x64 exception-directory function ranges (#14254)
* feat(pe): inspect x64 exception-directory function ranges Add inspect_pe_unwind_ranges, a provider-free reader of the PE32+ exception directory (.pdata). It reports each RUNTIME_FUNCTION's begin, end and unwind RVAs, whether the entry starts a function or is a chained fragment (UNW_FLAG_CHAININFO or an indirect unwind RVA), the chain's parent and primary entry, and empty, unsorted, overlapping, unmapped or unresolvable entries as explicit issues. Counts cover every entry while kind, offset and limit select the page. It reads headers through the shared PE image owner without changing its admission. Failures use the existing PE failure projection. Refs #14181 * chore(pe): record the unwind-ranges advertised schema and cursor skill * fix(pe): index chain parents, map the whole exception directory and keep high RVAs unsigned An unsorted table looked up every chain parent with a linear scan, and chain resolution did not yield, so a crafted table could stall the server. Parents are now found through one begin-RVA order and the pass yields to cancellation. The file-backed check covers every declared directory byte, including trailing bytes, and clearing the indirect bit keeps RVAs at or above 0x80000000 unsigned. * fix(pe): bound unwind reads and report unreadable codes, mismatched parents and unsorted overlaps Unwind data is visited in ascending RVA order, so the windowed reader moves forward and reads each region about once whatever the table order. A primary entry whose declared code array leaves the file-backed bytes is unknown (unwind_codes_unmapped), and its header facts are kept. A chain parent must match the whole RUNTIME_FUNCTION; an entry with the same begin but another end or unwind RVA is chain_parent_mismatch. Order and overlap are checked separately. The guide moves under docs/guides/native, and its route is unchanged. * fix(pe): index whole RUNTIME_FUNCTION records for chain parents Entries sharing a begin RVA were scanned for every parent lookup. The table is now ordered once by (begin, end, unwind), and a parent is a binary search for the exact record, with a second search for a begin mismatch. * test(pe): register the unwind-ranges provider lifecycle coverage The provider lifecycle registry needs one entry per provider id. Add rea-pe-unwind-ranges with its public CLI/MCP workflow and a typed resource and cancellation failure test. * test(cli): record inspect-pe-unwind-ranges in the completion goldens * fix(pe): keep a verified unwind report through cleanup failure and check the directory before its allowance A report completed before final close failed was replaced by the file hash. The provider now records the verified report and the shared PE failure projection retains it, as the ELF readers do. The entry allowance now applies only after the directory is shown file-backed, so an oversized count that leaves the file is a malformed target. * chore(pe): register the exception-directory entry allowance as a pending fixed ceiling |
||
|
|
67a1e2c937 |
feat(browser)!: size inspect_web_page delivery and page captures by section (#14368)
* feat(browser)!: size inspect_web_page delivery and page captures by section inspect_web_page returned the complete capture inline with no detail choice. A local page with 2,000 list rows, 200 buttons and three bundled libraries produced a 4.6 MB MCP result, mostly 6,423 DOM nodes and 10,614 accessibility nodes. inspect_web_page now declares the size-aware detail. Omitted, a capture up to 32 KiB is inline and a larger one is retained behind a summary of its small sections and counts. A new web-page view pages dom (node_names), accessibility (roles), console (types), network (methods), scripts and resources. The shared Evidence handler applies the same size decision as the other size-aware tools and keeps detail out of the capture parameters. BREAKING CHANGE: an MCP inspect_web_page call that omits detail on a capture above 32 KiB now returns the retained summary. Pass detail: "complete" for the previous shape, for example before compare_web_captures. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(cli): deliver inspect-web-page summaries through the Evidence bundle The contract's size-aware detail also generated a --detail option for rea inspect-web-page, but the command ignored it and always printed the complete capture. The command now uses the shared CLI Evidence delivery, as analyze-web-bundle does: omitted or complete detail prints the capture, and --detail summary requires --evidence_output and prints the summary with the bundle receipt. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(browser): bound web-page summaries and keep capture context on pages Review found three gaps in the new web-page view: - pages dropped the capture's completeness and the section's context, so an empty accessibility page looked like an exhausted one; - script rows carried their complete captured source, so one large bundle could not be paged; - the summary copied every frame and worker. Every page now carries the capture's completeness and its section's own context beside the page coverage. Script rows keep source metadata without text, and a script-source collection pages one script's text by UTF-16 offset. The summary counts frames and workers, which page through their own collections. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(browser): request complete captures in the real-browser verifiers The metadata-budget, URL userinfo, DOM destination and script export verifiers read the complete inspect_web_page capture through MCP. With size-aware delivery, an omitted detail above 32 KiB returns the summary, and the metadata-budget verifier failed reading scripts.items from it. These calls now request detail complete; their CLI calls already return the complete capture. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com> Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
0b51ca03de |
feat(ghidra): open M-profile raw images at a separate load base (#7951)
* test(raw): pin raw-binary admission and identity 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 |
||
|
|
029ad60f4f |
chore(deps): update 37 npm pins and preserve capture and release behavior (#14231)
* chore(deps): bump the npm-minor-and-patch group across 2 directories with 38 updates Bumps the npm-minor-and-patch group with 37 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) | `8.0.4` | `8.1.2` | | [@babel/types](https://github.com/babel/babel/tree/HEAD/packages/babel-types) | `8.0.4` | `8.1.2` | | [@bufbuild/protobuf](https://github.com/bufbuild/protobuf-es/tree/HEAD/packages/protobuf) | `2.16.0` | `2.17.0` | | [@clack/prompts](https://github.com/bombshell-dev/clack/tree/HEAD/packages/prompts) | `1.7.0` | `1.9.0` | | [@zip.js/zip.js](https://github.com/gildas-lormeau/zip.js) | `2.15.0` | `2.25.0` | | [evmole](https://github.com/cdump/evmole/tree/HEAD/javascript) | `0.9.3` | `0.9.4` | | [ignore](https://github.com/kaelzhang/node-ignore) | `7.0.6` | `7.0.14` | | [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git) | `1.38.7` | `1.44.15` | | [lossless-json](https://github.com/josdejong/lossless-json) | `4.3.1` | `4.3.3` | | [parse5](https://github.com/inikulin/parse5) | `8.0.1` | `8.1.1` | | [playwright-core](https://github.com/microsoft/playwright) | `1.64.1` | `1.65.1` | | [plist](https://github.com/TooTallNate/plist.js) | `5.0.0` | `5.1.1` | | [semver](https://github.com/npm/node-semver) | `7.8.5` | `7.8.6` | | [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` | | [smol-toml](https://github.com/squirrelchat/smol-toml) | `1.9.0` | `1.9.1` | | [stream-chain](https://github.com/uhop/stream-chain) | `4.2.6` | `4.4.2` | | [stream-json](https://github.com/uhop/stream-json) | `3.7.0` | `3.9.0` | | [ws](https://github.com/websockets/ws) | `8.21.0` | `8.23.0` | | [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` | | [yaml](https://github.com/eemeli/yaml) | `2.9.0` | `2.9.1` | | [zod](https://github.com/colinhacks/zod) | `4.6.6` | `4.6.7` | | [@electron/asar](https://github.com/electron/asar) | `4.2.0` | `4.3.2` | | [@stryker-mutator/core](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/core) | `10.0.0` | `10.1.1` | | [@stryker-mutator/typescript-checker](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/typescript-checker) | `10.0.0` | `10.1.1` | | [@stryker-mutator/vitest-runner](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/vitest-runner) | `10.0.0` | `10.1.1` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.6.4` | `26.6.6` | | [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` | | [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` | | [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `5.0.3` | `5.1.0` | | [jscpd](https://github.com/kucherenko/jscpd/tree/HEAD/rust/jscpd) | `5.0.12` | `5.4.3` | | [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) | `6.39.0` | `6.45.1` | | [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) | `0.72.0` | `0.79.0` | | [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) | `1.87.0` | `1.94.0` | | [oxlint-tsgolint](https://github.com/oxc-project/tsgolint) | `7.0.2005` | `7.0.2007` | | [release-please](https://github.com/googleapis/release-please) | `17.3.0` | `17.11.2` | | [rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown) | `1.2.12` | `1.3.2` | | [turbo](https://github.com/vercel/turborepo) | `2.11.7` | `2.11.11` | | [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.3` | `5.1.0` | | [frida](https://github.com/frida/frida-node) | `17.23.2` | `17.26.4` | Bumps the npm-minor-and-patch group with 1 update in the /scripts/verify-tools/skills directory: [skills](https://github.com/vercel-labs/skills). Updates `@babel/parser` from 8.0.4 to 8.1.2 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-parser) Updates `@babel/types` from 8.0.4 to 8.1.2 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-types) Updates `@bufbuild/protobuf` from 2.16.0 to 2.17.0 - [Release notes](https://github.com/bufbuild/protobuf-es/releases) - [Commits](https://github.com/bufbuild/protobuf-es/commits/v2.17.0/packages/protobuf) Updates `@clack/prompts` from 1.7.0 to 1.9.0 - [Release notes](https://github.com/bombshell-dev/clack/releases) - [Changelog](https://github.com/bombshell-dev/clack/blob/main/packages/prompts/CHANGELOG.md) - [Commits](https://github.com/bombshell-dev/clack/commits/@clack/prompts@1.9.0/packages/prompts) Updates `@zip.js/zip.js` from 2.15.0 to 2.25.0 - [Release notes](https://github.com/gildas-lormeau/zip.js/releases) - [Commits](https://github.com/gildas-lormeau/zip.js/compare/v2.15.0...v2.25.0) Updates `evmole` from 0.9.3 to 0.9.4 - [Release notes](https://github.com/cdump/evmole/releases) - [Commits](https://github.com/cdump/evmole/commits/0.9.4/javascript) Updates `ignore` from 7.0.6 to 7.0.14 - [Release notes](https://github.com/kaelzhang/node-ignore/releases) - [Commits](https://github.com/kaelzhang/node-ignore/compare/7.0.6...7.0.14) Updates `isomorphic-git` from 1.38.7 to 1.44.15 - [Release notes](https://github.com/isomorphic-git/isomorphic-git/releases) - [Commits](https://github.com/isomorphic-git/isomorphic-git/compare/v1.38.7...v1.44.15) Updates `lossless-json` from 4.3.1 to 4.3.3 - [Changelog](https://github.com/josdejong/lossless-json/blob/main/CHANGELOG.md) - [Commits](https://github.com/josdejong/lossless-json/compare/v4.3.1...v4.3.3) Updates `parse5` from 8.0.1 to 8.1.1 - [Release notes](https://github.com/inikulin/parse5/releases) - [Commits](https://github.com/inikulin/parse5/compare/v8.0.1...v8.1.1) Updates `playwright-core` from 1.64.1 to 1.65.1 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.64.1...v1.65.1) Updates `plist` from 5.0.0 to 5.1.1 - [Release notes](https://github.com/TooTallNate/plist.js/releases) - [Changelog](https://github.com/TooTallNate/plist.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/TooTallNate/plist.js/compare/plist@5.0.0...plist@5.1.1) Updates `semver` from 7.8.5 to 7.8.6 - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.8.5...v7.8.6) Updates `@types/semver` from 7.7.1 to 7.8.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Updates `smol-toml` from 1.9.0 to 1.9.1 - [Release notes](https://github.com/squirrelchat/smol-toml/releases) - [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.9.0...v1.9.1) Updates `stream-chain` from 4.2.6 to 4.4.2 - [Commits](https://github.com/uhop/stream-chain/compare/4.2.6...4.4.2) Updates `stream-json` from 3.7.0 to 3.9.0 - [Commits](https://github.com/uhop/stream-json/compare/3.7.0...3.9.0) Updates `ws` from 8.21.0 to 8.23.0 - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.21.0...8.23.0) Updates `@types/ws` from 8.18.1 to 8.18.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) Updates `yaml` from 2.9.0 to 2.9.1 - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1) Updates `zod` from 4.6.6 to 4.6.7 - [Release notes](https://github.com/colinhacks/zod/releases) - [Commits](https://github.com/colinhacks/zod/compare/v4.6.6...v4.6.7) Updates `@electron/asar` from 4.2.0 to 4.3.2 - [Release notes](https://github.com/electron/asar/releases) - [Changelog](https://github.com/electron/asar/blob/main/CHANGELOG.md) - [Commits](https://github.com/electron/asar/compare/v4.2.0...v4.3.2) Updates `@stryker-mutator/core` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/core/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/core) Updates `@stryker-mutator/typescript-checker` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/typescript-checker/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/typescript-checker) Updates `@stryker-mutator/vitest-runner` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/vitest-runner/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/vitest-runner) Updates `@types/node` from 26.6.4 to 26.6.6 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@types/semver` from 7.7.1 to 7.8.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Updates `@types/ws` from 8.18.1 to 8.18.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) Updates `@vitest/coverage-v8` from 5.0.3 to 5.1.0 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/coverage-v8) Updates `jscpd` from 5.0.12 to 5.4.3 - [Release notes](https://github.com/kucherenko/jscpd/releases) - [Commits](https://github.com/kucherenko/jscpd/commits/v5.4.3/rust/jscpd) Updates `knip` from 6.39.0 to 6.45.1 - [Release notes](https://github.com/webpro-nl/knip/releases) - [Commits](https://github.com/webpro-nl/knip/commits/knip@6.45.1/packages/knip) Updates `oxfmt` from 0.72.0 to 0.79.0 - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.79.0/npm/oxfmt) Updates `oxlint` from 1.87.0 to 1.94.0 - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.94.0/npm/oxlint) Updates `oxlint-tsgolint` from 7.0.2005 to 7.0.2007 - [Release notes](https://github.com/oxc-project/tsgolint/releases) - [Commits](https://github.com/oxc-project/tsgolint/compare/v7.0.2005...v7.0.2007) Updates `release-please` from 17.3.0 to 17.11.2 - [Release notes](https://github.com/googleapis/release-please/releases) - [Changelog](https://github.com/googleapis/release-please/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/release-please/compare/v17.3.0...v17.11.2) Updates `rolldown` from 1.2.12 to 1.3.2 - [Release notes](https://github.com/rolldown/rolldown/releases) - [Changelog](https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md) - [Commits](https://github.com/rolldown/rolldown/commits/v1.3.2/packages/rolldown) Updates `turbo` from 2.11.7 to 2.11.11 - [Release notes](https://github.com/vercel/turborepo/releases) - [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md) - [Commits](https://github.com/vercel/turborepo/compare/v2.11.7...v2.11.11) Updates `vitest` from 5.0.3 to 5.1.0 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/vitest) Updates `frida` from 17.23.2 to 17.26.4 - [Commits](https://github.com/frida/frida-node/compare/17.23.2...17.26.4) Updates `skills` from 1.7.2 to 1.9.0 - [Release notes](https://github.com/vercel-labs/skills/releases) - [Commits](https://github.com/vercel-labs/skills/compare/v1.7.2...v1.9.0) --- updated-dependencies: - dependency-name: "@babel/parser" dependency-version: 8.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@babel/types" dependency-version: 8.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@bufbuild/protobuf" dependency-version: 2.17.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@clack/prompts" dependency-version: 1.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@electron/asar" dependency-version: 4.3.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/core" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/typescript-checker" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/vitest-runner" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/node" dependency-version: 26.6.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@types/semver" dependency-version: 7.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/semver" dependency-version: 7.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/ws" dependency-version: 8.18.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@types/ws" dependency-version: 8.18.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@vitest/coverage-v8" dependency-version: 5.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@zip.js/zip.js" dependency-version: 2.25.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: evmole dependency-version: 0.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: frida dependency-version: 17.26.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: ignore dependency-version: 7.0.14 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: isomorphic-git dependency-version: 1.44.15 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: jscpd dependency-version: 5.4.3 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: knip dependency-version: 6.45.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: lossless-json dependency-version: 4.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: oxfmt dependency-version: 0.79.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: oxlint dependency-version: 1.94.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: oxlint-tsgolint dependency-version: 7.0.2007 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: parse5 dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: playwright-core dependency-version: 1.65.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: plist dependency-version: 5.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: release-please dependency-version: 17.11.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: rolldown dependency-version: 1.3.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: semver dependency-version: 7.8.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: skills dependency-version: 1.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: smol-toml dependency-version: 1.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: stream-chain dependency-version: 4.4.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: stream-json dependency-version: 3.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: turbo dependency-version: 2.11.11 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: vitest dependency-version: 5.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: ws dependency-version: 8.23.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: yaml dependency-version: 2.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: zod dependency-version: 4.6.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): adapt release tooling and capture metadata to the new npm pins * fix(deps): preserve numeric, plist and archive evidence semantics * test(zip): verify malformed compression with CRC checks enabled * fix(capture): preserve exact decimal projections and redaction * test(apple): verify keyed archive controls before altering the trailer * test(lint): cover safe and suggested regex escape fixes * fix(reference): preserve directory exclusion provenance with ignore 7 * docs(examples): refresh HAR evidence identities for the current decoder * fix(reference): preserve metadata failures with strict Git ref reads * chore(config): remove the unused MCP profile type alias --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
417beaf3a5 |
fix(evidence): preserve saved identities with canonicalize 5 (#8132)
chore(deps): bump canonicalize from 3.0.0 to 5.1.0 Bumps [canonicalize](https://github.com/erdtman/canonicalize) from 3.0.0 to 5.1.0. - [Release notes](https://github.com/erdtman/canonicalize/releases) - [Commits](https://github.com/erdtman/canonicalize/compare/v3.0.0...v5.1.0) --- updated-dependencies: - dependency-name: canonicalize dependency-version: 5.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
73f72c9cd6 | refactor(build): share skill file enumeration across generators (#14339) | ||
|
|
4f0d160254 |
refactor(tooling): share verifier fixture and lint helpers (#14318)
* refactor(tooling): share verifier fixture and lint helpers * test(clients): retain tool messages in verifier model substitutes |
||
|
|
b565f787cb |
refactor(cli/server): break remaining module-layer cycles (#14013)
* refactor(cli,server): break remaining module-layer cycles * fix(ci): follow relocated CLI entry points * refactor: remove retired internal reader exports |
||
|
|
88dfad5bb7 |
refactor: remove internal re-export shims and guard against new ones (#14009)
* refactor: remove internal re-export shims and guard against new ones * fix(ci): catch namespace module re-exports |
||
|
|
a5d427a2d1 | chore(guards): declare desktop build-computer entries and clear the entry baseline (#14011) | ||
|
|
3db9120c5e |
fix(ghidra): point to the LC_MAIN entry when a stripped Mach-O has no main symbol (#12966)
* fix(ghidra): derive the LC_MAIN entry address from bounded snapshot reads * fix(ghidra): point to the LC_MAIN entry when a stripped Mach-O has no main symbol * fix(ghidra): keep snapshot cleanup failures from the LC_MAIN hint read * fix(ghidra): admit the LC_MAIN segment's file range before hinting * fix(ghidra): give no LC_MAIN hint for an entry in a file-only segment admitMachoSegmentCommand admits a segment with no VM size and no protection but marks it unmapped; it owns no analysis address, so the hint must not name one. * fix(ghidra): confirm Mach-O entry retries against the function inventory * fix(hopper): offer inventory recovery for unresolved selectors * fix(ida): offer inventory recovery for missing procedures --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
16732c6b72 | fix(release): bind checkpoint references to frozen history (#13392) | ||
|
|
ac0dd6b371 | fix(verification): isolate MCP package canaries from target settings (#13256) | ||
|
|
eacbd2522a | fix(verification): distinguish MCP probe refusals from local deadlines (#13246) | ||
|
|
eba41afd6c | fix(browser): retain passive coverage and failure identity (#13231) | ||
|
|
39ccb1d3b8 | fix(browser): preserve terminal verifier startup outcomes (#13228) | ||
|
|
ce5258043c | test(docs): isolate README drift cases and remove duplicate checks | ||
|
|
d2a8b8d3d6 | fix(docs): align translated READMEs and verify catalog links | ||
|
|
6822ebe1f3 |
feat(ida): support the official Hex-Rays IDA MCP headlessly (#4813)
* feat(ida): support the official Hex-Rays IDA MCP headlessly Hex-Rays IDA MCP serves database reads only through execute_python, so REA rejected it as an upstream. A `hexrays` headless stdio registration now leases a private idalib worker through open_database, answers the existing database-supervisor reads with a fixed, packaged, read-only query module, and releases the lease with close_database, verified by list_databases. Observations record execute_python, the query and the module digest. Tool errors are typed so a completed rejection is distinguished from an unknown outcome; an unconfirmed release is retried and a late lease on the private input is adopted. Validated IDA source and bridge tests, static checks, docs, and npm run verify:ida on Linux x64 against x86-64 and AArch64 ELF fixtures. * feat(ida): name the Hex-Rays registration for its catalog A registration without `protocol` that reaches the official Hex-Rays server failed with only the missing database-supervisor tools. Startup profile failures now report the advertised catalog, and when it is the Hex-Rays one the message and recovery name the `hexrays` registration. Refs #1416 * docs(ida): state Hex-Rays prerequisites and upstream session traces Upstream needs IDA 9.4 or later with idalib, Python 3.11 or later, uv and Git. The profile does not analyze databases open in the IDA GUI, and the server keeps its own session traces outside REA's workspace. Refs #1416 * fix(ida): skip inline data when scanning Hex-Rays calls The call scan decoded every head that FuncItems yields. Inline data such as a jump table can decode as a call and refer to a function or import, which reported false callees and call-graph edges. Skip non-code heads before decoding, as disassembly already does. Refs #1416 * fix(ida): retain Hex-Rays health reads in evidence The identity and readiness reads around each operation kept only their parsed result, dropping the bridge digest and any engine output. Keep them whole as health_observations beside the parsed metadata, in both successful and partial-failure Evidence. Refs #1416 * test(ida): list the Hex-Rays bridge in package fixtures The packed-bridge verifier has required bridge/ida/hexrays_queries.py since the Hex-Rays profile landed, but three package tests still built their member lists without it. The verifier stopped at that file, so 21 cases failed or asserted on the wrong omission. Refs #1416 * feat(ida): open existing IDA databases through the Hex-Rays profile A headless open re-ran auto-analysis from the input binary, discarding the names, types and comments of an existing database and taking far longer on large targets. Target admission now identifies IDA databases by their IDA1/IDA2 signature, and the hexrays profile opens a private copy of one; Hopper and the other IDA profiles reject them. The copy is required, not incidental: idalib repacks a database when its last lease is released, even without a save. A database reports the input it was created from, so the session is bound to the opened copy's idb_path, and health now reports the input SHA-256 it records. Validated with resolver, provider and session tests, check:fast, docs:check and test:changed, plus a real Hex-Rays MCP run against a 1.4 GB SC2 .i64 whose original file was left byte-identical. Refs #1416 * fix(ida): verify the private workspace of a database target by idb_path * test(ida): fix Hex-Rays health stand-ins and Windows path and runtime teardown * refactor(ida): resolve the registration once for target support * docs(ida): record the real Hex-Rays run on an existing .i64 * docs(ida): make the Hex-Rays registration example install-neutral * chore: keep merge-hook formatting outside the IDA change * fix(ida): retain live Hex-Rays databases this server does not lease A list_databases row with instance_id null is a live owner, not a stopped database. Mapping it to the supervisor's released-worker shape made cleanup delete files another client still held. Unleased rows stay active, so the private path must leave inventory before the workspace is removed. Accept idat inventory rows, hash the query bridge with sha256Hex, and complete databaseEngine on Hopper fixtures added on main. * fix(ida): report uncapped Hex-Rays call graphs * docs(ida): link to the Hex-Rays bridge on GitHub * fix(ida): verify Hex-Rays worker identity and cleanup * feat(ida): support Hex-Rays idat headless workers Refs #12921 * fix(ida): retain workspace after ambiguous Hex-Rays startup * fix(ida): preserve typed Hex-Rays call edges and deadlines * test(ida): verify Hex-Rays cleanup with a peer lease * test(ci): use project deadlines for the Cutter verifier * test(ida): keep verifier cleanup fixtures scoped to mocked modules * fix(ida): retain the worker backend in partial evidence --------- Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
4449d13047 | test(evaluation): consolidate report verdict and output checks (#12882) |