mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 17:23:37 +08:00
main
250
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c2ed07fdc0 |
feat(dotnet): inventory a managed assembly's enums, enum arguments and GUID literals (#17366)
Add inventory_managed_features across CLI and MCP to report enum definitions, direct constant enum arguments, and GUID literals with CIL sites and retained summary views. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
e5004c11ea |
feat(managed): recover protobuf descriptors from .NET assemblies (#17287)
* feat(managed): describe the protobuf descriptor recovery report and its budget Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): recover protobuf descriptors from generated Reflection classes Google.Protobuf's generated <File>Reflection classes build each FileDescriptorProto in a static constructor that concatenates string literals and passes them to System.Convert.FromBase64String. Read those literals from the CIL in order, decode each site and keep the results that parse as FileDescriptorProtos, byte for byte. A FileDescriptorSet lists them dependencies first, with the well-known protobuf files they import; other imports are named as missing. Literal characters count against max_descriptor_bytes before they are joined. Nothing is loaded or run. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): report descriptor recovery refusals as parse failures A metadata representation budget stops the whole call as a named limit, including inside one static constructor; other managed reader refusals become malformed or unsupported input. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): recover protobuf descriptors through an identity-checked provider The provider reads one bounded managed assembly. A refusal at max_descriptor_bytes, max_metadata_representation_bytes or max_snapshot_bytes names the control to raise. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(analysis): summarize retained protobuf descriptor recovery Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): add the recover_protobuf_descriptors tool CLI recover-protobuf-descriptors and MCP recover_protobuf_descriptors return each embedded .proto file's package, imports, messages, enums and services, and a FileDescriptorSet for decoding captured payloads. Large reports return the retained per-file summary within the agent budget. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(managed): cover protobuf descriptor recovery through the service, MCP and CLI The protoc-style assembly fixture moves to tests/fixtures so the unit, MCP and CLI tests share it. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): describe protobuf descriptor recovery Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): route Google.Protobuf assemblies to recover_protobuf_descriptors Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * ci: scope protobuf descriptor recovery with the managed formats Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * chore(schemas): record the advertised recover_protobuf_descriptors catalog summary Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): attribute, bound and account for every descriptor search - Static constructors are found among physical MethodDef rows and named by the shared ownership lookup, so a MethodPtr table cannot attribute a descriptor to the wrong type. - A FileDescriptorProto's wire form is walked along its schema first, and every nested message it would create is charged to the representation budget before protobuf-es decodes it. - A body whose CIL was not fully decoded, and malformed member lists, make coverage partial instead of looking searched. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(managed): build descriptor fixtures in protoc's String.Concat shapes The fixture's static constructor now joins its literals through String.Concat, as arguments or a string[], before calling FromBase64String with its real static byte[](string) signature; the managed PE fixture can name each MemberRef row. Tests cover both forms and the descriptor tree bound. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(analysis): sample missing imports in the protobuf descriptor summary Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): save the descriptor set from complete delivery and fail on null Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): name the descriptor nesting limit instead of rejecting deep files The nesting cutoff is now the max_descriptor_depth control (100 by default, up to 1,000). A deeper descriptor stops the call with a named limit rather than being listed as not a descriptor, and protobuf-es decodes up to the same depth so it cannot refuse what the walk admitted. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): list the descriptor depth budget and record its schema Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
e1b66df5bc |
feat(native): recover UniFFI library interfaces from exports (#17215)
* feat(native): describe the UniFFI library report and its read budgets Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(native): recover UniFFI interfaces from a library's exports Group a library's UniFFI scaffolding exports by namespace: objects named by their free and clone functions with their constructors and methods, functions, callback interfaces and runtime helpers. The contract version and each item's checksum are read from function bodies that return only that constant (x86, x86-64 with or without endbr, arm64), and NAMESPACE and UDL_FILE metadata buffers are decoded. Nothing is called; a method that two object names could own is listed under the longer and counted. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(native): read UniFFI libraries through an identity-checked provider The provider reads one bounded PE or ELF file, maps its export addresses through the image's own declarations and decodes the UniFFI interface. A refusal at max_entries, max_text_bytes or max_file_bytes names the budget to raise. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(analysis): summarize retained UniFFI library reports Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(analysis): bound the UniFFI summary's namespaces with boundedList Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(native): add the inspect_uniffi_library tool CLI inspect-uniffi-library and MCP inspect_uniffi_library recover a UniFFI library's namespaces, objects, methods, functions, callback interfaces, contract version and checksums from its exports without loading it. Large reports return the retained per-namespace summary within the agent budget. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(native): describe UniFFI interface recovery Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): route UniFFI libraries to inspect_uniffi_library Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * ci: scope the UniFFI reader with the native formats Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * chore(schemas): record the advertised inspect_uniffi_library catalog summary Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): keep UniFFI grouping linear and its omissions visible - Namespaces, metadata owners and object owners are found by looking up each underscore-delimited prefix of a name, instead of scanning every namespace or object for every export. - A body or metadata buffer reads the longest mapped prefix, so a constant that ends at its mapping's end is still decoded. - A metadata buffer that cannot be read or decoded is counted apart from kinds this reader does not decode, and makes coverage partial. - A partial export table carries its reasons into the report. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(native): expose max_structure_bytes for UniFFI library inspection The export reader's table-size limit is now a caller control, and its refusal names it, as inspect_native_exports does. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(cli): honour delivery options for inspect-uniffi-library Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(native): list the UniFFI structure budget and record its schema Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): match UniFFI namespaces and owners with a prefix trie Namespaces, metadata owners and object owners are now found by walking the name once through a trie of the known words, from the positions where UniFFI spells them. The cost per name grows with its length, not with its underscore count squared or with the number of known words. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): index UniFFI prefixes by hash instead of a character trie A character trie allocated a node and a map for every distinct prefix, so long crafted export names could exhaust the heap before the report's text checks. The prefix index now keeps one entry per known word, keyed by two polynomial hashes, and walks each name once computing the hashes of its underscore-ended prefixes; only the longest matches are compared. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): map UniFFI reads through one index and check namespace shapes - Constant and metadata reads use one file-mapping index built with the image's zero-filled ranges, so each read is a lookup and an ambiguous address reads as unknown instead of as definite bytes. - The ELF container read honours max_structure_bytes, as the export read already did. - 32-bit x86 images, which the shared readers name 386, decode their constants. - A scaffolding symbol belongs to the longest namespace whose remainder has a scaffolding shape, so a namespace ending in _fn cannot take another namespace's functions. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): carry the export reader's issues into a partial UniFFI report A partial export table now reports its first issues by code and message, counting the rest, before falling back to its limitations. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(native): consider every shaped namespace match for UniFFI symbols The scaffolding shape after a namespace is now checked while the name is walked, so every span followed by _fn_ or _checksum_ is a candidate, not only the longest four matches; only the chosen word is compared. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
e5945805a4 |
feat(managed): inspect WPF BAML documents (#17167)
* feat(managed): generate WPF's known BAML type and property IDs BAML names WPF's own types, properties and strings by negative IDs. The table is generated from KnownTypes.cs and Baml2006KnownTypes.cs at a pinned dotnet/wpf commit, with the source digests recorded and the MIT license preserved. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): describe the BAML document report and its read budgets Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): decode BAML record streams into their element tree Read the BAML 0.96 records WPF's Baml2006Reader reads, without loading any type: the element tree with names, keys and code-behind connection IDs; property values with their converters, markup extensions and known binary serializers; dictionary keys and their static resources from the deferred key section; bindings and resource references. WPF's own types, properties and strings are named from the generated known-type table. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(analysis): summarize retained BAML documents Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): read BAML files through an identity-checked provider The provider reads one bounded regular file and decodes it; a refusal at max_records, max_elements or max_file_bytes names the budget to raise. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): add the inspect_baml tool CLI inspect-baml and MCP inspect_baml decode a WPF BAML document, such as a view extracted from <Assembly>.g.resources, without loading WPF or the document's assemblies. Large reports return the retained summary within the agent budget. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): point .NET resource sets with BAML views at inspect_baml A resource set now proposes extraction, and inspect_baml when it holds .baml members. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): describe WPF BAML document inspection Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): route extracted BAML views to inspect_baml Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * ci: scope the BAML reader with the managed formats Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * build: expose the BAML provider and its identity as dotnet entry files Composition constructs the provider and the capability declarations name its identity, as they do for the managed static provider. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(managed): fold BAML coverage through the coverage accumulator Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(managed): refuse oversized BAML files through the shared parse-limit owner Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * chore(schemas): record the advertised inspect_baml catalog summary Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * build: fetch the pinned WPF sources for the BAML known-type table The generator now downloads KnownTypes.cs and Baml2006KnownTypes.cs at the pinned dotnet/wpf commit and checks their recorded digests, instead of reading a caller-supplied checkout, and runs as npm run generate:wpf-baml-known-types. The regenerated table is unchanged. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(managed): cover inspect-baml through the CLI and declare its conformance case Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): recognise BAML documents and route them to inspect_baml A file that starts with the MSBAML FormatVersion header is a standalone baml artifact; inspect_artifact proposes inspect_baml for it, as it does for other formats a dedicated tool reads. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(managed): add a max_text_bytes budget for reported BAML text Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): bound BAML expansion and validate its nesting and dictionaries - Every reported copy of a declared name counts against max_text_bytes, so repeated references to one long name cannot expand without bound. - The nearest open element is kept on its own stack, and a property or constructor scope must open directly inside an element. - Deferred content must fit its document and enclosing section; each dictionary key's value position must start a value element. - Bindings inside MultiBinding or PriorityBinding report the container's target property. - A test names WPF's known IDs by the literal numbers of the pinned source. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): describe BAML recognition and the text budget Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * chore(schemas): record the inspect_baml max_text_bytes input Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): inherit BAML binding targets instead of walking ancestors Each element records the binding target it inherits, so a binding inside nested MultiBinding or PriorityBinding containers resolves its target in constant time. TemplateBinding and resource-extension elements now also charge their reported copies against max_text_bytes. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): count declared BAML type and assembly names against the text budget Every declared type reports its assembly's name, so many types can repeat one long assembly name; those copies now count against max_text_bytes too. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
c2960db49f |
feat(artifacts): inventory resources embedded in .NET assemblies (#17105)
* refactor(managed): read ManifestResource rows and the CLI Resources directory separately Split a ManifestResource row's columns from its data, so a caller that holds only the metadata can list resources, and let the CLI header prefix report its Resources directory when it is read that far. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): bound .NET assembly manifest resource admission Add the dotnet_assembly reader limit group: the resource count follows the session member count, and metadata bytes bound the CLI metadata read to list ManifestResource rows. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): locate a managed image's metadata and Resources directory Read only the PE headers, section table and CLI header to find where a managed image keeps its metadata and embedded manifest resources, so recognition does not load the image. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): list the manifest resources a .NET assembly embeds Add the dotnet-assembly reader. It reads the ManifestResource rows from the CLI metadata and lists each resource embedded in the Resources directory as its stored bytes. Linked resources are named in the root metadata, since their bytes live in other files. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): open managed assemblies with embedded resources as containers A PE whose CLI header declares a Resources directory, and that carries no other package, now inventories as dotnet-assembly, so a WPF assembly's .g.resources can be extracted and inspected as a resource set. Managed inspection still leads its next probes; extraction follows. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): describe resources embedded in a .NET assembly Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): route assemblies with embedded resources to extraction Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * ci: scope the .NET assembly resource reader with the managed formats Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): keep located managed directories inside the file A section can declare raw data past the end of the file. A metadata or Resources directory mapped there is now malformed at location, instead of failing the later exact read. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): report invalid manifest resource rows once Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): require a complete CLI header before locating managed directories Check the declared header size against the 72-byte header and the CLI directory, and that the whole header lies in the file, as the managed PE reader does. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(managed): build fixtures that embed several manifest resources Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): inventory manifest resource names as flat keys Names such as `a` and `a/b` are distinct resources. Inventory keeps both, as it does for resource set names; extraction still refuses to write conflicting paths together. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): add decode and retained-name controls for .NET assemblies Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): bound assembly resource names and keep readable rows The metadata decode budget is now the group's representation_bytes control, so a refusal names a field the caller can raise. Every listed name counts against retained_name_bytes before output is built, since rows can share one stored name. A row whose name cannot be read is skipped and counted instead of refusing the whole assembly. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): list the .NET assembly reader controls Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(artifacts): pass the classified managed location to the assembly reader Classification carries the located metadata and Resources directory in a typed admission for the same descriptor, so the reader does not locate them again. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): explain a damaged CLI Resources directory on extraction Extraction now refuses such a PE with the location's reason instead of reporting that the format has no reader. Inspection keeps the PE root, where managed inspection reports the CLI header. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): require the CLI header's declared size inside the file Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
bce9e5dbe9 | ci(website): refresh the contributor list weekly (#17116) | ||
|
|
c07901b9c9 |
feat(artifacts): inventory and extract .NET resource sets (#17072)
* feat(managed): decode .NET resource set headers and values Parse the ResourceManager and RuntimeResourceSet headers of a .resources stream, its name table and each entry's type code and payload range, as System.Resources.ResourceReader lays them out. Fixed-size primitives get a decoded value; strings, byte arrays and streams are payload ranges; serialized user types are named from the type table and never decoded. The test fixture writes resource sets the way ResourceWriter does, and its output is byte-identical to .NET Framework 4.8 ResourceWriter for the same values. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): bound .NET resource set admission Add the dotnet_resources reader limit group: the resource count follows the session member count, and the type count and header bytes bound what a reader holds before it reaches the data section. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): read .NET resource sets as members Serve each named resource of a .resources stream as a member whose bytes are one range of the set: a string's UTF-8 bytes, a byte array's or stream's payload, or a primitive's stored bytes with its decoded value in the entry metadata. Serialized objects are listed by type name. Names that are not safe paths, malformed values, hash table damage and version 1 sets are reported as limitations. Entry heads are read through windows of the data section in offset order, so a large set costs few reads. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): recognize .NET resource sets for inventory and extraction Claim a .resources stream by its 0xBEEFCACE magic and a usable ResourceManager header, open it as an archive target, and register the extractable dotnet-resources container so inspect_artifact, extract_artifact and inventory views reach its members. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(artifacts): cover .NET resource sets through the artifact provider Open a resource set as a target, inventory its members with value facts, extract payloads, and recover from a resource count limit. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): document .NET resource set inventory Describe how resource sets are recognized, what each member's bytes and metadata hold, which values stay unknown, extraction, and reader admission. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(reference): list .NET resource set limits and compared metadata Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): route .NET resource sets to artifact inventory Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(managed): read resource set fields through BinaryReader Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): sync the Cursor plugin skill Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(artifacts): select the .NET resource count among explicit member counts Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * test(artifacts): resolve .NET resource limits from the member count setting Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(managed): reject negative type codes and show Local dates as UTC instants A version 2 type code decoded as a negative Int32 is malformed, so the entry is omitted instead of failing the metadata schema. DateTime.ToBinary stores a Local value's UTC instant, so it is shown with a Z suffix like a Utc value. Name records are read without decoding, so callers can bound decoded names. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * feat(artifacts): bound retained .NET resource names Count every decoded name, including names several table entries share, against dotnet_resources.retained_name_bytes. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): bound shared resource names and keep neighbors' data ranges Entry data ranges now come from every record with a data offset, so an entry whose name does not decode no longer extends its neighbor. Decoded names are charged against retained_name_bytes; a set that exceeds it keeps the members read before the limit. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): inventory .NET resource names that collide as paths Resource names are flat keys, so a and a/b are distinct resources. Inventory lists both, as for PyInstaller, Bun and Deno members, and extraction still refuses to write colliding destinations together. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(managed): describe resource name limits, flat keys and DateTime instants Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * refactor(managed): report resource set header failures through ParseFailureError The header parser now throws the shared parse failure with the format, offset and field: truncated with the available and required bytes, unsupported for a set version ResourceReader does not read, limit naming the exceeded artifact_limits.dotnet_resources field, and malformed otherwise. Name and value decoders take the caller's BinaryReader instead of allocating one per record, and the metadata schemas live in formatMetadata. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * fix(artifacts): report the full retained name requirement in bytes The retained name refusal now names every reference's bytes, which are known before decoding, so retrying with that value succeeds, and both byte allowances report the bytes unit. The reader maps shared parse failures, grows its header read on truncation inside the set, and holds one reader per name section and data window. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * ci: select the Apple artifact lane for .NET resource set changes Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(cli): show .NET resource set inventory and extraction Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> * docs(skill): describe .NET resource set members for agents Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --------- Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
33b2763423 |
feat(artifacts): inspect PlayStation PS-X EXE headers (#16251)
* feat(artifacts): inspect PlayStation PS-X EXE headers A file starting with the PS-X EXE magic is inventoried as psx-exe. Root metadata reports the initial PC and GP, the text, data and BSS ranges, the stack base and offset with the initial SP, the region marker and its licensed region, and whether the file length agrees with 0x800 plus the declared text size. header.bin and text.bin are stored ranges; text.bin carries its load address and holds only the bytes present. A file shorter or longer than the declared text, or a text size that is not a whole number of 2048-byte sectors, leaves coverage unknown with the offset involved. A file that ends inside the header is refused as truncated with the offset where it ends. Nothing is executed. * fix(artifacts): read PS-X EXE fields through BinaryReader and match regions exactly A region marker such as constructor matched an inherited property of the region table, so the metadata held a function and inventory failed when it was cloned. Regions now come from a Map. Header words are read through BinaryReader instead of a local decoder. The fixture writes literal offsets with distinct non-zero values, including data and a stack offset, and the guide says inventory reads the members to hash them. * fix(artifacts): validate PS-X file sizes and name the omitted text member * test(artifacts): extract PS-X EXE members in the reader test * style(artifacts): format the PS-X reader test --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
208b81d724 |
feat(artifacts): inspect Game Boy and GBA ROM headers (#16249)
* feat(artifacts): inspect Game Boy and GBA ROM headers Game Boy and Game Boy Color images (game-boy-rom) are claimed when at least the first 24 bytes of the boot logo at 0x104 match, the half every boot ROM compares. Root metadata reports the entry code and its JP target, full or top-half logo match, title and manufacturer code, CGB and SGB flags, mapper and features, declared ROM and RAM sizes, destination, licensee codes, version, and declared and computed header and global checksums. The global checksum is summed over the file in bounded reads. Game Boy Advance images (gba-rom) are claimed from an ARM branch at 0, the fixed 0x96 at 0xB2, and the boot logo or a matching complement check. Root metadata reports the entry branch target, logo match, title, game and maker codes, fixed value, unit and device type, version, the complement check, and the multiboot fields when that layout could apply. Both serve header.bin and program.bin as stored ranges. Logos are compared by SHA-256 digest, so no logo bytes are carried. Checksum, logo and size disagreements leave coverage unknown; a header cut short is refused as truncated with the offset where the file ends. * fix(artifacts): keep missing GBA multiboot fields unknown and pin checksum vectors A GBA file that ends inside the multiboot fields reported boot_mode and slave_id as zero. They are now null, with a limitation naming where the file ends. The Game Boy reader charges artifact_limits.expanded_bytes from the file size before it sums the file for the global checksum. Checksum tests now use hand-derived vectors instead of copying the parser's own result. * refactor(artifacts): read Game Boy and GBA header fields through BinaryReader The GBA parser decoded words with a local reader that read missing bytes as zero. Both parsers now read header fields through BinaryReader, as the tool-design guide requires, after their length checks. The fixtures write literal offsets instead of the parsers' field constants, and the guides say inventory reads the stored members to hash them. * fix(artifacts): read documented GB size codes and MBC4, refuse truncated GBA headers * style(artifacts): format the handheld ROM test --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
a37994b3e8 |
feat(artifacts): inspect MetaTrader EX4 and EX5 program headers and resources (#16501)
* feat(artifacts): inspect MetaTrader 5 EX5 program headers and resources Recognize compiled MQL5 programs by their EX5 magic and inventory them through inspect_artifact and extract_artifact. Report the program type, compiler build, copyright/link/version property slots, nonzero header fields of unknown meaning, and the resource table. List the opaque body and resource payloads as stored byte ranges; nothing is decrypted, decompressed or decompiled. Refs #16495 * feat(artifacts): read MetaTrader 4 EX4 programs with the EX5 layout EX4 (magic EX-) shares the EX5 header, property slots and resource table, so both containers become one mql-program format with a container field. The version slot is 64 bytes and the opaque body starts at 0x2E8 in both containers; the earlier 0x3A8 header length counted 192 opaque bytes as part of the version slot. EX4 type code 3 is a library; build is reported under a neutral name because its EX4 meaning is not established. * fix(artifacts): bound repeated MQL resource ranges and let tar outrank printable magics Resource records may share one payload range, and each occurrence is hashed and extractable, so the reader now charges every record against artifact_limits.expanded_bytes, as the DTBO reader does. A checksum-valid tar header now runs before the recognizers that match a printable magic at offset 0. A tar whose first member was named EX-..., GDPC... or UnityFS was claimed as an MQL program, Godot PCK or UnityFS. Slot text keeps a leading U+FEFF, which is declared content rather than an encoding mark. * fix(artifacts): refuse an invalid tar header only after leading-magic formats Only a checksum-valid tar header outranks the printable leading magics. A Godot pack can hold ustar at 257 inside its own content without a valid tar checksum; refusing that header first rejected the valid pack. * fix(artifacts): compare MetaTrader resource declarations A resource's name, kind, record index and unpacked size live in the resource table, outside the stored payload that content comparison hashes, so a renamed resource compared as unchanged. Compare them as the resource's declaration, as tar, ar and UnityFS members do. * fix(artifacts): keep unreadable MetaTrader resource names unknown in comparison |
||
|
|
c2b3ca2b11 | refactor(ci): simplify portable test failure details (#16415) | ||
|
|
096f25ba23 | refactor(ci): share static task receipt hashes (#16404) | ||
|
|
89ecc756bb | refactor(ci): share portable cache file requirements (#16401) | ||
|
|
7094cd4b5e | refactor(ci): share PR detail identity normalization (#16395) | ||
|
|
42337906b6 | refactor(ci): share job timing percentile summaries (#16389) | ||
|
|
bfe132cc01 | refactor(ci): share duplication report clone-file schema (#16384) | ||
|
|
cfaee2f5f7 |
feat(build): add non-turbo source-build path for freebsd (#15247)
* feat(build): add non-turbo source-build path for freebsd * test(build): keep direct-build coverage runnable without turbo and reap build children * test(build): use processTest fixture and long-running tag for build tests --------- Co-authored-by: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com> |
||
|
|
b8947412f7 | refactor(ci): share workflow identity validation (#16204) | ||
|
|
7b247b4946 | refactor(ci): share direct member checks for Darwin gates (#16136) | ||
|
|
3e2547f44d | refactor(ci): consolidate health report input validation (#16117) | ||
|
|
e6a4a20ea8 | refactor(ci): simplify ordered failure predicates (#16113) | ||
|
|
3930e84b10 |
refactor(ci): share changed-path lane ownership lookup (#16058)
* refactor(ci): share changed-path lane ownership lookup * fix(ci): keep planner documentation on its declaration |
||
|
|
71340a7ab9 | refactor(ci): share PR health page scanning (#15994) | ||
|
|
c58cc7151c | refactor(ci): reuse job timing samples in report totals (#15985) | ||
|
|
104c1c189e |
test(clients): verify native OpenCode integration against OpenCode V2 (#10178)
* test(clients): verify native OpenCode integration against OpenCode V2 The OpenCode client lane targeted OpenCode V1 (opencode-ai@1.18.35) and could not pass against OpenCode V2. The V2 skill tool names its argument `id`, so the lane's `{ name: ... }` call was rejected with "id: Missing key" and the personal skill never loaded. Bring the lane to OpenCode V2: - Call the skill tool with `id` under V2 and keep `name` for V1. - Register REA in the native `mcp.servers` table and read additional skill sources from the `skills` array; grant tool access with a `permissions` ruleset. The V1 dialect remains selectable with `REA_VERIFY_OPENCODE_DIALECT=v1`. - OpenCode V2 groups MCP tools behind its Code Mode tool by default, so the lane sets the documented `codemode: false` server option to observe the forwarded catalog as direct function tools. REA's refresh preserves that client-owned option, which the lane now covers. - Start a private server under V2. The shared background service keeps the environment it started with and would read the caller's own configuration instead of the lane's isolated one. - Isolate the home for both platforms. The lane set only USERPROFILE, so a POSIX run resolved the caller's real home for the shared skill directory. - Take the expected catalog from the runtime under test, so `REA_VERIFY_RUNTIME_ROOT` can point at an installed package whose catalog differs from this checkout. - Record the dialect, plugin-isolation mechanism and tool surface in the receipt. OpenCode V2 dropped OPENCODE_PURE, so the V1 isolation claim no longer described what ran. The lane no longer refuses Windows, so the OpenCode integration can be verified on a native Windows host. * fix(clients): isolate OpenCode verifier config and coverage claims Clear inherited OPENCODE_CONFIG and OPENCODE_CONFIG_CONTENT so the lab cannot load the caller's configuration layers. Record V2 as verified only on native Windows and leave POSIX V2 explicitly unverified. * fix(clients): pin OpenCode verifier to a full REA catalog Clear inherited REA_MCP_TOOL_FAMILIES and set REA_MCP_TOOL_CATALOG_PROFILE=full so setup and the MCP child always advertise the complete catalog the fixture asserts. * fix(ci): pin Native MCP OpenCode checks to @opencode/cli@2.2.7 The verifier defaults to the OpenCode V2 dialect, but the Native MCP registration workflow still installed opencode-ai@1.19.6 without selecting v1. Point the matrix at the published V2 CLI that supports the V2 config and --standalone. * fix(clients): harden OpenCode V2 verifier modes and launch seeds Keep Code Mode enabled for scoped-chat and assert the paginated catalog search, clear inherited REA MCP capacity/schema settings that can reject fixture calls, and accept Aube-managed shim launchers alongside the raw Node/script/mcp shape. * fix(clients): only require Code Mode catalog search for OpenCode V2 * fix(clients): clear OpenCode verifier ambient budget and Windows env aliases Unset inherited REA_AGENT_RESULT_BUDGET_BYTES so the fixture keeps complete Evidence, and delete cleared OpenCode/REA launch seeds case-insensitively before spawn so mixed-case Windows aliases cannot survive. * fix(clients): require Windows packaged OpenCode runtime and isolate V2 ancestors Document that Windows call verification needs REA_VERIFY_RUNTIME_ROOT with a matching packaged runtime, and refuse OpenCode V2 lab runs when an ancestor project configuration file would join the private server. * fix(clients): qualify POSIX OpenCode V2 coverage and dialect Windows hint Limit checked-in POSIX V2 claims to scoped-chat catalog search and point Windows preflight recovery at the selected OpenCode package major. * fix(clients): match OpenCode runtime contracts and clear registration seeds Reject a REA_VERIFY_RUNTIME_ROOT whose package version or tool catalog differs from this checkout, and clear every selected registration setting from SetupRegistrationEnvironment instead of a hand-maintained MCP list. * fix(verification): bind OpenCode fixtures to selected runtime * fix(verification): refuse discovered OpenCode plugin sources * test(verification): reject plugins before starting OpenCode * test(ci): exercise packaged OpenCode on Windows * fix(verification): type the selected-runtime fixture reader * chore(ci): use pinned npm for Windows client proof * docs(verification): distinguish Windows runner isolation * test(verification): keep compiled fixtures in the built test lane * test(verification): type catalog fixtures without generated output * fix(ci): classify automated OpenCode verification |
||
|
|
df081bf7ac |
ci(test-selection): run every portable test when error classification changes (#15705)
* ci(test-selection): run every portable test when error classification changes Boundary and acceptance tests pin the code, category and retry class a refusal reports, but reach src/domain/analysisError* only through the built CLI or MCP server, so PR selection never picked them. A classification change (#15588) passed CI and left stale pins that failed later on unrelated PRs. Treat a change to that owner as untraceable so the plan falls back to the complete fast suite. The rule lives in test selection rather than SHARED_BOUNDARY, because that list also limits lane planning to a single naming lane and would drop the four lanes that name these files. * style(ci): format test selection |
||
|
|
61f1dede46 |
fix(resources)!: refuse Windows names ending in a dot or space (#15653)
* fix(resources)!: refuse Windows names ending in a dot or space Node writes files through `\\?\` paths on Windows, so a member named `dir/name.` or `dir/space ` is created literally. Win32 path normalization drops a trailing dot or space when other programs open the path, so `dir\name.` reads the bytes of a sibling `dir\name`, and `dir\space ` cannot be opened. The extraction manifest then records a digest for a path that ordinary tools resolve to different bytes. A Windows output tree now refuses any path segment that ends in a dot or space with DestinationPathUnrepresentableFailure, before creating the path, using the trailing rule isPortablePathSegment already applies. The refusal names the cause and the next step. Reserved device names stay accepted, since Node creates them as ordinary files. Every writer that materializes target-derived names goes through SafeOutputTree (extract_artifact, firmware and UEFI publication, desktop export, environment bundles, recovered JavaScript sources, web script export), so all of them apply the rule. Web script export already moves an unrepresentable URL path to its isolated layout. Fixes #15613 BREAKING CHANGE: On Windows, extract_artifact and other output-tree writers now refuse a path with a segment ending in a dot or space, where they used to write it. To extract the rest of such an archive on Windows, select occurrence_ids that leave those members out, or extract on a non-Windows host. Web script export on Windows writes such URL paths under its isolated layout instead. * ci: run Windows extraction name tests in the curated Windows lane |
||
|
|
130243a7c1 |
fix(setup): recognize path-qualified cmd.exe and npm rea.cmd shims (#15045)
* fix(setup): recognize path-qualified cmd.exe and npm rea.cmd shims Unwrap C:\Windows\System32\cmd.exe /d /c package runners, and read the script an npm rea.cmd shim launches so those registrations stay owned. * fix(setup): parse npm rea.cmd launch statements with a bounded read Own only the script argument of the npm cmd-shim launch line, skip rem comments, refuse oversized files before allocating, and join with host path rules so UNC roots stay intact. * fix(setup): ignore echoed npm launch text in rea.cmd shims Skip echo lines and refuse ownership when a later "%_prog%" launch names a non-package script, so printed paths cannot prove an unrelated row. * fix(setup): require executed npm rea.cmd launch statements Anchor "%_prog%" matching to a real launch command, skip @rem comments, and ignore conditional echo lines so ownership cannot follow text that is never executed. * fix(setup): require strict npm cmd-shim structure for rea.cmd ownership * fix(setup): match exact npm cmd-shim template for rea.cmd ownership * fix(client-identity): reject batch variables and support local node_modules/.bin rea.cmd shims * fix(setup): recognize current npm command shims * fix(ci): route CMD shim tests to the Windows package lane --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
4886a406f9 |
fix(release): recover verified versions after npm advances (#15234)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> |
||
|
|
fbb113b0d0 |
fix(release): confirm npm absence with an exact-version lookup (#15233)
* fix(release): confirm npm absence with an exact-version lookup * test: cover the reviewed CI boundary cases * fix(release): share the npm registry lookup deadline --------- Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com> Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
9d5c5f687d |
fix(process): accept legal characters in Windows batch paths (#15128)
* fix(process): quote Windows batch operators cmd.exe keeps literal cmd.exe with delayed expansion off keeps & | < > ( ) ^ ! literal inside quotes. Empty tokens and %name% spans are still refused, including when that name is unset, because the child environment can define it. * fix(process): report a refused batch path as invalid configuration A percent expansion or an unusable COMSPEC is configuration_invalid. Packet capture does not append the Wireshark install remediation, and an apktool decode does not report a capability gap. * fix(process): refuse percent spans joined across batch tokens cmd.exe expands a percent span on the joined command line. Tokens that are legal alone are refused when joining them forms a span. The spawn regression kills its child if that child is still running after 10 seconds. * test(process): include the Windows batch regression in CI The curated Windows lane now runs WindowsBatchCommand.test.ts. * fix(domain): preserve a configuration error's caller message ConfigurationError accepted userMessage and dropped it, so the public projection replaced the caller text with the generic doctor sentence. The constructor now stores that message. * fix(pcap): keep a batch refusal in the public configuration message A Windows batch refusal stays in the configuration error the caller sees, including the refused path and the percent-expansion reason. * fix(apktool): report a decode batch refusal as invalid configuration Inspection still reports not_configured. Decoding reports configuration_invalid and names the launcher that cmd.exe cannot receive. A percent span that appears only after the quoted tokens are joined is refused the same way. * test(process): own the Windows batch regression in the package lane The curated Windows job already runs WindowsBatchCommand.test.ts. The package scope did not name that file, so the lane ownership check reported it as unowned. |
||
|
|
54a700e18c |
fix(ghidra): use host transport defaults for direct clients (#6410)
* fix(tests): make three Windows-failing tests pass and give the Ghidra transport one owner Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(ghidra): cover the per-platform default bridge transport defaultGhidraTransport had no direct test. Pins authenticated loopback TCP on win32 and a Unix socket on linux and darwin. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test(ghidra): retain Windows transport boundary coverage * test(ghidra): align Java fixtures with their host platform * ci(ghidra): verify transport and byte search on Windows * test(ghidra): keep Windows probes in the existing test process * fix(ghidra): await complete Windows endpoint publication * test(ghidra): use owned child identities for Windows fixtures * ci(ghidra): own the Windows transport regression inputs --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
60de294646 |
fix(process): compare Windows server paths by native realpath (#15044)
* fix(process): compare Windows server paths by native realpath compareServerPaths returned mismatch for every non-equal Windows path, so case, separator, 8.3, and junction spellings of the running server were reported as registration_path_mismatch. Compare native realpaths on Windows, matching registration identity: a different existing file still mismatches and an unresolvable path stays unknown. * test(process): run the server path identity regression on Windows The injected win32 platform only selects the comparison branch; on the Linux source-test host realpathSync.native still uses POSIX rules, so Windows letter case, separators, and junction behavior were unverified. Add Windows-only spelling cases beside the portable regression and include the file in the curated Windows lane, with the lane guard asserting it stays there. * ci(windows): own the server identity regression in the package lane The Windows lane now runs serverIdentity.test.ts, so the package scope must own that path for the native-host lane ownership check. * docs(process): clarify server path comparison authority --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
c12177ce0d |
perf(ci): confirm test-only macOS selection on Linux (#15203)
* perf(ci): confirm test-only macOS selection on Linux * fix(ci): keep explicit Apple scope in job admission * perf(ci): publish the build cache only for confirmed consumers |
||
|
|
91380cff6a |
fix(ci): run npm lifecycle hooks in selected host lanes (#15169)
* fix(ci): run npm lifecycle hooks in selected host lanes * fix(ci): avoid nested lifecycle hooks in host lanes --------- Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> |
||
|
|
21cfc809bc |
ci(windows): run the caller path separator regression in the Windows lane (#4988)
test(ci): keep the separator regression in the Windows-only lane guard Fold windowsTargetSeparators.test.ts into the existing guard for Windows-only cases instead of a separate test with the same reason. Co-authored-by: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com> |
||
|
|
2dcdacce92 |
fix(ci): accept a skipped selection the macOS lane runs
A selection whose every module is gated to macOS, such as a change to only tests/acceptance/applications/nativePlistNesting.test.ts, can only report skipped modules on Linux, and the portable report then failed with 'Every portable test module was skipped' although the macOS lane ran the tests. The report now accepts an entirely skipped selection when the plan selected the macOS lane and every reported module is gated to macOS by the same isDarwinGatedTestSource rule that the macOS lane uses to discover its tests. The summary says so. Any other entirely skipped selection, and an entirely skipped complete suite, still fail. Fixes #14596 Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
48cef4662f |
fix(ci): select the macOS lane when every selected test may be gated to it
The plan selected the macOS lane only for a changed test that may be gated to macOS. A source change whose affected tests are all such modules left Linux to skip every one of them while no lane ran them. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
88373e3fba |
feat(apple): inspect Image4 (IMG4, IM4P, IM4M) firmware containers offline (#14907)
* feat(apple): inspect Image4 (IMG4, IM4P, IM4M) firmware containers offline Image4 files are recognized from a DER SEQUENCE whose first element is the IA5String IMG4, IM4P, or IM4M, independent of the filename, and are inventoried as apple-img4. The stored payload octet string is exposed as payload, the embedded IM4M sequence as manifest.der, and the IM4R sequence as restore-info.der. Keybags contribute a count and key types, with initialization vectors and keys left out of metadata; an encrypted payload is refused on open; signatures and certificates are reported by size; LZFSE and complzss payloads stay compressed; IM4R property names are listed and their values stay redacted. Four fixed allowances refuse excessive DER depth, element count, property count, and string length, and inventory coverage is unknown whenever a limitation is recorded. * fix(apple): read Image4 fields by universal tag and position Compare universal tag numbers instead of identifier octets, so constructed OCTET STRING and string values are recognized and reported. Read IM4P fields by position so an unsupported payload keeps its slot and a constructed keybag still marks the payload encrypted. Walk every constructed value once, caching the children of header-walked values so each element is charged once, and check large values a consumer does not decode. Report unknown restore members, extra property and object fields and a mistyped certificate chain. Decode UTF8String as UTF-8, accept DER sign padding on unsigned 32-bit integers, and recognize the magic with the shared BER header decoder. * fix(apple): read IM4P and IMG4 slots by position and keep unknown counts null Follow img4tool and img4lib: after the payload, an optional keybag OCTET STRING, then an optional compression SEQUENCE, then PAYP in [0]; IMG4 holds IM4P, [0] IM4M and [1] IM4R in that order. A value outside its slot is reported as unknown and never takes another field's role, and an EXPLICIT wrapper holds exactly one value. An absent or undecodable description is null rather than empty, and an undecoded keybag reports a null count and types instead of zero; a decoded keybag counts every entry. * fix(apple): keep Image4 compression unknown when it cannot be read An encrypted payload without a compression field, or a declared algorithm other than LZFSE with no recognizable magic, now reports compression "unknown" instead of "none". Make ia5Text the single owner of the retained-text allowance so a string too large to tree-parse is refused rather than reported absent, keep the canonical BOOLEAN check in the structural pass only, check the keybag's inner SEQUENCE through the shared decoder instead of its first octet, note a manifest version other than 0, and name the spec constants after their sources. Add a hand-encoded IM4P golden that does not use the fixture builders. * fix(apple): keep stopped Image4 slots and bound retained bytes A value whose end cannot be found keeps its identifier, so a stopped keybag still marks the payload encrypted and a stopped payload keeps its slot; the values after it become a limitation. The IMG4 payload slot is consumed whatever it holds, so an unsupported value does not hide the manifest and restore slots. A property body that is not a SET or SEQUENCE is reported instead of read as empty, and an entry whose name cannot be read is one unknown entry whose value is never walked for more names, so restore values stay redacted. Load a value only when it may be decoded and fits an 8 MiB retained budget; larger primitives and values past the budget are walked by header. * fix(apple): keep restore properties opaque and small fields readable A PRIVATE-tagged restore value is one property: only its name is reported, and its value is never searched for names, even when the name is unreadable or is IM4R. Only the IM4R property SET is walked as a container. Small primitives are always loaded, so names and scalars stay readable after the retained budget is used. A declared uncompressed size that is negative or not an exact integer is reported as a limitation. * fix(apple): reserve tree budget only for parsed values and keep PRIVATE manifest entries opaque Reserve retained bytes only for a value that will be tree-parsed, so a ranged wrapper around a large payload no longer uses budget a later small indefinite value needs. A PRIVATE manifest entry must name itself; when its name cannot be read it is reported and its value is never interpreted as manifest facts. * fix(apple): report MANB, MANP and IM4R entries with no body A MANB, MANP or IM4R entry that holds only its name is a missing body, not a confirmed-empty one, so it is reported as a limitation while sibling facts are kept. * fix(apple): require a SEQUENCE for named manifest entries A context-, application- or other-tagged manifest value that begins with a name is unsupported structure, reported as an unknown tag rather than read as a manifest entry. * fix(apple): assign IMG4 values to slots by position and context tag One slot assigner owns the IMG4 layout: a context-tagged value fills the slot with its tag number, skipping earlier optional slots, and any other value occupies the next slot even when it cannot fill it. An unsupported manifest value therefore no longer hides a following [1] IM4R. --------- 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: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com> |
||
|
|
ba1ddffd7e |
feat(artifacts): inspect Sega Mega Drive and Genesis ROM headers offline (#14895)
* feat(artifacts): inspect Sega Mega Drive and Genesis ROM headers offline These ROMs are inventoried as containers. A plain image matches when the four bytes at offset 0x100 are SEGA; an SMD dump matches the copier mark 0xAA 0xBB and a block count whose de-interleaved bytes carry SEGA, then the odd and even halves are merged into the linear image. The root record stores the 68000 vectors, header strings, declared and computed word checksum, ROM and RAM ranges, devices, external RAM, and region, with members vectors.bin, header.bin, and program.bin (SMD members carry an image offset and a null file range). A checksum or range disagreement leaves coverage unknown, 32X and Sega CD remain labels only, and a file past 8 MiB or 512 SMD blocks is refused under the named fixed ceilings before its body is buffered; the shared region reader maps that refusal onto the typed allowance, and the guide, CLI, supported-targets table, CI scopes, and ceiling registry include the format. * Address review feedback * Address review feedback * Address review feedback * fix(artifacts): read Mega Drive work RAM on the 24-bit bus and keep ambiguous regions A header that declares work RAM as 0xE0FF0000-0xE0FFFFFF, the SGDK default, was reported outside the work-RAM window because the check compared full 32-bit values. The 68000 drives 24 address lines, so the window check now compares bus addresses; metadata keeps the declared values. A region field of a lone A, B or E is both a classic region letter and a one-digit mask, and references disagree on which it is. It was reported as letters with no limitation. It is now region_style ambiguous, keeps both readings in region_characters and region_mask, and records a limitation. * refactor(artifacts): name Mega Drive header fields once and share the SMD half layout Header field offsets and lengths were literals repeated at each read, and device support was sliced twice from separate literals. One TEXT_FIELDS table, the named numeric offsets and the EXTERNAL_RAM block now hold the layout, citing SGDK's rom_head.c and Genesis Plus GX's getrominfo and sram_init. SMD recognition and de-interleaving each encoded which block half holds the odd bytes. Both now use SMD_ODD_HALF and SMD_EVEN_HALF, and the decoder takes the block count from the de-interleaved image instead of recomputing it from the file size. The SMD round-trip test only checked the fixture against its own inverse. It now also pins the fixture's file bytes to the Genesis Plus GX deinterleave_block layout. * fix(artifacts): model the Mega Drive 68000 bus once and decide SMD dumps before ESP images Header addresses were compared in three places with two rules: the RAM check masked to 24 bits while the reset-PC check compared raw 32-bit values, and neither knew the work-RAM mirror. One owner now holds the MC68000 24-bit bus (the top byte is not driven) and the Mega Drive work RAM, 64 KiB mirrored through 0xE00000-0xFFFFFF (Genesis Plus GX gen_init maps pages 0xE0-0xFF to it). The reset PC is checked against the ROM range on that bus, so 0xFF000200 fetches from 0x200, and a RAM range is work RAM when it covers at most 64 KiB inside the mirror, such as 0xE00000-0xE0FFFF. Metadata keeps the declared values. An SMD dump of 233 or 489 blocks has 0xE9, the ESP image magic, in its copier header's block-count byte, so the ESP image recognizer claimed it. The shared recognizer table now decides the SMD layout, whose signature also needs the AA BB mark, interleaved SEGA bytes and an exact size, before the ESP recognizers, and the plain layout keeps its place after the leading-magic formats. * fix(docs): restore separate Mega Drive and N64 entries after the main merge * fix(mega-drive): read ROM range and checksum window on the 24-bit bus The reset PC check already masked the top address byte, but ROM ordering, extent, the nonzero-start note and the checksum window still used the raw declared endpoints. A 0x400-byte image declaring 0xFF000000-0xFF0002FF summed through 0x3FF instead of 0x2FF, and a full 0xFF000000-0xFF0003FF alias was marked incomplete. Derive bus addresses once in the parser and keep the declared values in metadata. * fix(artifacts): order every Mega Drive header range on the 24-bit bus The ROM range was ordered on the 68000 bus, but the RAM range and the external RAM range still compared raw 32-bit endpoints. A header whose endpoints alias through different top bytes, such as RAM 0xE0FF0000-0x00FFFFFF, was reported as reversed even though the bus range is the 0xFF0000-0xFFFFFF work RAM. The bus owner now has one ordering rule, busOrdered, and the ROM, RAM and external RAM checks all use it. Declared values stay in metadata. A range whose end wraps past the 24-bit bus, such as 0xFF0000-0x1000000, is now reported as reversed, which is what the bus sees. * fix(artifacts): keep truncated region failures typed and publish Mega Drive bus addresses A region decoder could only report malformed, limit or unsupported, and the shared DecodedRegionArtifactReader mapped every kind but malformed to a fixed-limit refusal. A recognized Mega Drive header cut short was therefore reported as malformed, and an unsupported region failure would have surfaced as a limit. RegionDecodeFailure now has truncated, with the measured extent, and the reader maps each kind to its own typed failure: malformed, truncated, unsupported or limit. The header checks already interpret ROM, RAM and reset addresses on the 68000's 24-bit bus, but metadata exposed only the stored longwords, so the raw m68k hand-off told callers to load at the stored ROM start. A header that stores 0xFF000000 then loads at the wrong address. ROM and RAM ranges now carry bus_start and bus_end, the reset vector carries reset_pc_bus, and the guide and skill hand off with rom.bus_start. --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
3273cbd1e2 |
fix(mutation): unblock the daily mutation sweep (#14748)
* fix(mutation): include every mutated file in the mutation project Stryker's typescript-checker watches the files the mutation project includes. A mutated file the project leaves out has no watcher, and the sweep aborts with "no watcher is registered for it" before it reports a score. The semantics suite mutates src/rizin/RizinDebugFrames.ts and src/rizin/RizinDebugEvidence.ts, and the reverse-tools suite mutates src/domain/analysisResourceLimits.ts; none of the three was in tsconfig.reverse-tools-mutation.json, so the daily mutation sweep failed before it produced a report. Add the three files to the project. Add scripts/verify/mutation-target-tsconfig.mjs, which reads the resolved mutation targets from both configurations and fails when the project does not cover them or lists a file the repository no longer has. The guard runs in the deep static lane and before the sweep, so the drift is reported by name instead of as a checker abort. * fix(mutation): give the reverse-tools sweep the time it needs The reverse-tools suite reached 805 of 1008 mutants after 57 minutes of mutation testing on the 2026-11-26 scheduled run and was killed by the 60-minute job budget before it could report a score. The suite needs about 70 minutes of mutation testing plus the setup it runs before it. Raise the job budget to 90 minutes so the sweep reports instead of being cancelled. The budget is the only change; the suite and its mutant set are untouched. * fix(ci): select mutation quality for debugger limit changes --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
17b53ee004 |
feat(artifacts): inventory Nintendo 64 ROM images and normalize byte order offline (#14911)
* feat(artifacts): inventory Nintendo 64 ROM images and normalize byte order offline An n64-rom image is recognized from the first word in z64 (80 37 12 40), v64 (37 80 40 12), or n64 (40 12 37 80) order plus a 4-byte-aligned boot address in KSEG0 or KSEG1. The reader normalizes the cartridge header and serves header.bin, ipl3.bin, and program.z64 in big-endian order, swapping v64 and n64 bytes and recording that swap as decoded. It names the IPL3/CIC variant from the CRC32 of bytes 0x40..0x1000 and, for a known variant, recomputes the CRC pair over the 1 MiB window; a mismatch, unknown CIC, short window, or non-zero reserved header bytes leave coverage unknown, and a file above 64 MiB is refused before any swap. Comparison ignores n64-rom and n64-rom-entry metadata so dump order is not treated as a content change, and decoded members share the idle-abort helper the Switch executable reader now calls. * fix(n64): admit members before reading and follow each byte order's swap unit Charge artifact_limits.expanded_bytes from the file size and byte order before the checksum window is read and swapped. The member layout now has one owner, n64RomRegions, which the parser and the allowance both use. The length rule follows the order's swap unit, as in mupen64plus-core: a z64 image of any length needs no swap, a v64 image needs an even length and an n64 image a multiple of 4. The guide now says that a printable destination byte outside the known table keeps its code with a null destination_name. * refactor(n64): name header fields from the spec and share the boot-address check Header offsets, the first-word magics, the CIC 6105 table offset and the KSEG bounds are now named constants with their reference sources, and recognition and parsing share one boot-address decision. A closed-form test checks the cartridge checksum on an all-zero window for every CIC, derived from the checksum routine rather than from n64CartridgeCrc. * fix(n64): keep the present bytes of a final partial word in the checksum window The checksum routine now reads one defined window, n64ChecksumWindow: the image through 0x101000 with only the bytes past a shorter file taken as zero. A z64 or v64 image that ends inside a word keeps that word's bytes instead of losing the whole word. The limitation now says how many bytes were assumed. --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
5865eeea93 |
fix(ci): preserve the 75-minute npm visibility deadline (#14761)
* fix(ci): preserve the 75-minute npm visibility deadline * test(ci): use ES2023-compatible registry deadline fixture * refactor(ci): keep the npm visibility deadline at the polling boundary --------- Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> Co-authored-by: Kei Ito <angila-antonia-casey@dr.com> |
||
|
|
1a09a8ef46 |
fix(ci): bound packet capture prerequisite acquisition (#14716)
* fix(ci): bound packet capture prerequisite acquisition * test(ci): enforce packet capture prerequisite order --------- Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com> Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> |
||
|
|
cd744b1bfb | fix(ci): require complete path references for test coverage (#14819) | ||
|
|
48adc9df0b |
fix(ci): fall back when a changed test fixture has no traced consumer (#14709)
* fix: deepen verified coverage for PR #14354 * test(ci): assert the selected fixture consumers --------- Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com> |
||
|
|
2a4c8ccfba |
fix(ci): clear stale static diagnostic context before recording (#14713)
* fix(ci): clear stale static diagnostic context before recording * test(ci): align inherited Mach-O assertion with main --------- Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com> Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com> |
||
|
|
51b3671b08 |
feat(artifacts): inventory Nintendo DS ROM binaries, overlays and file tables offline (#14664)
* feat(artifacts): inventory Nintendo DS ROM binaries, overlays and file tables offline Recognition now claims a Nintendo DS ROM from the cartridge header: stored logo CRC 0xCF56, unit code 0, 2, or 3, an ARM9 offset after the header, and a matching logo-area or header CRC. Inspection records those header facts on the root and lists arm9.bin, arm7.bin, overlays/<cpu>/overlay_<id>.bin, FNT-named data/<path> files, and unnamed fat/<id>.bin files as stored byte ranges. A checksum mismatch, a partial table, or a range past the end of the file leaves coverage unknown. Secure-area encryption, compressed overlays, and NitroARC archives stay undecoded, and the format is registered for inventory, extraction, and the docs. * docs: move the Nintendo DS ROM guide under guides/firmware * Address review feedback * Address review feedback * Address review feedback * fix: Compare NDS entry addresses and overlay facts * fix(artifacts): bound NDS path expansion and enforce expanded_bytes * fix(artifacts): omit NDS format declaration for ordinary filesystem files --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
2bb086c87a |
feat(providers): retain native selection provenance in Evidence (#9668)
* feat(providers): retain provider selection provenance with session evidence The registry records how a deep provider became selected and why every other candidate was rejected, and binary_session exposes those facts for the active route. Evidence already carried provider identity, but nothing recorded which candidates the session evaluated, so a retained record could not explain why this engine produced the observation or what the alternatives were. Attach provider_selection to Evidence admitted by the session: the selection source and, for each evaluated candidate, its identity and version, selection state, availability and target-support outcome, and the stable rejection codes. The field is optional and excluded from semantic identity, following caller_input_path, so each admitted record stays attributable to the exact provider instance without changing observation identity, evidence IDs or replay. Copy only stable selection facts. Candidate diagnostics, remediation prose and target content stay in the session status projection instead of being repeated in every record. * style(domain): reformat the provider-selection assertion oxfmt --check rejected the three-line expect() call; the formatter's single-line layout is the canonical one, so Static checks failed only on formatting. * fix(evidence): keep a rejected record inside the Result boundary `recordEvidence` ran `withEvidenceProviderSelection` before handing the record to the ledger. That helper parses to seal the rebound envelope, so a tampered or otherwise invalid record threw a `ZodError` from the attribution step and never reached `EvidenceLedger.record`, which is where the declared `Result` is produced. `tests/boundary/mcp/processEvidenceIdentityMcp.test.ts:454` asserts `session.recordEvidence(tampered).ok === false` and fails on the throw. Authenticate the input first and return the ledger's own rejection for a value it would refuse anyway; attribution then only ever sees a record its reader accepts. * fix(binary): attribute imported records to the recording session Import replaces a same-ID record's presentation metadata, and provider_selection is part of that metadata. When runDirectAnalysis imports the provider's own bundle, the copy it rebuilds carries no selection, so the import erased the attribution the session had stamped and the caller kept an unattributed record instead. Attribute at both merge sites, where the session already authenticates everything it admits. A refreshed route after a failed switch can bind a different selection than the one the earlier binding held, so re-derive it there as the initial open does; spreading the previous binding kept the stale value. * fix(binary): admit record input before sealing it for attribution recordEvidence and the two bundle import paths seal Evidence through withEvidenceProviderSelection before handing it to the ledger. A sealed value skips the ledger's ordinary-JSON and heap-headroom admission, so a session with no authentication allowance accepted a mutable record and a large record was copied and traversed before the guard ran. Hold the caller's own value to that admission first, then attribute. The import paths also refuse with a Result instead of falling through to an unattributed import when admission fails. * fix(binary): re-attribute a sealed record without traversing it again recordEvidence now admits the caller's value before attributing it, but a record returned by evidenceForAnalysis has already been through that admission and is sealed. Running the ordinary-JSON walk and the heap-headroom check over it again repeats the work the ledger itself skips for a sealed value. Ask the ledger first: a value it holds is the admission it made, so the check costs one lookup. Only a value the ledger has not seen pays for the full walk. * fix(providers): return the recorded Evidence after import Import re-stamps session provenance onto the Evidence it records, but callers kept the pre-import copy, so retained selection attribution and cache metadata were dropped from what analysis reported. Read the recorded record back after a successful import, and leave an already-retained record as the ledger attributed it instead of re-deriving attribution from the caller's copy. * fix(providers): keep the caller's copy when re-attributing an imported record The merge with main brought in the unchanged-record path, where an import whose only change is display metadata now replaces the ledger's record. Re-attributing that incoming value put the session's provider selection on the caller's copy, so the import reported a record that differed from what the caller sent. Attribution now applies only to records the ledger does not already hold. The snapshot cache test now asserts the session's attribution explicitly instead of byte equality with the un-attributed source. * fix(providers): keep the caller's record when importing over a retained one The previous change skipped attribution for a record the ledger already held, which left the imported copy's own selection — missing or from another session — in place. Import replaces a same-ID record's presentation metadata, and provider_selection is part of it, so the session's attribution wins over the caller's copy while the caller's other display metadata is kept untouched. * fix(providers): attribute staged snapshot and unknown-mutation Evidence Address the open review findings on session provider provenance: - importAnalysisSnapshot merged the re-attributed bundle into the ledger but staged the snapshot's own bundle, so AnalysisSnapshotCache rebuilt replay bindings from records the merge had replaced. Hand the merged bundle back to the stage so replays bind to the attributed evidence. - recordResult recorded an attributed record and then serialized the caller's copy, so successful MCP responses omitted provider_selection while the ledger and exports carried it. Read the recorded Evidence back before delivery, as the direct analysis path already does. - recordUnknown and updateUnknown synthesized unknown-mutation Evidence without the active session's provider selection, so those exported records were unattributed. Thread the binding's selection through to unknownMutationEvidence, which is where the record is produced. * fix(providers): attribute the atomic Evidence-and-Unknown mutation record recordEvidenceWithUnknown synthesizes its own rea.residual-unknown-mutation record, so the selection the session threads into recordUnknown and updateUnknown never reached it. The atomic comparison workflows therefore exported one record without provider_selection, contradicting the guarantee that every admitted record carries the recording session's selection. Thread the active binding through the atomic method as well; analyst-authored mutation records still keep analyst-inference authority and gain only the session selection. * fix(evidence): require one selected candidate in provider provenance provider_selection carries no separate selected-provider id, so a reader can only name the recording session's provider when exactly one candidate claims the selection. The schema accepted any candidates array, so an imported bundle could re-export zero or several selected candidates under a stable Evidence id and consumers would have no way to resolve the provider. The recording paths always derive the selection from a single bound provider (AnalysisProviderRegistry selects one usable candidate, and SessionProviderRouter marks only the bound id selected), so the refine rejects only foreign input. * fix(evidence): adopt the recording session's selection on a duplicate record Recording an observation the ledger already holds under the same semantic ID returned duplicate and discarded the attributed object, so lookup and export kept the imported record's missing or foreign provider_selection. Replace the retained display metadata with the active selection on that path; semantic identity and the stored payload stay the same record. The provenance schema also accepted a selected candidate that is unavailable or unsupported, which no registry path can bind. Require the selected candidate to be available and supported so an imported bundle cannot re-export a selection that never occurred. * fix(evidence): keep retained display metadata and notify observers on duplicate Attribution replaced the whole stored record with the incoming copy, so a provider-produced duplicate without the caller-selected path, alias set or subject display erased the metadata the recording session retained merely to add provider_selection. Adopt only the display facts the incoming copy actually carries; omission is not deletion. Import keeps its documented replace semantics. The duplicate branch also returned before refreshEvidenceMetadata and #emitSnapshotChanged, so replay caches and snapshot subscribers kept the old metadata after a successful replacement. Treat a non-no-op replacement exactly as the import path does. * fix(artifacts): compare Evidence by identity across a replay session The composed-workflow test opened a second fixture, which writes its own temp artifact, so a replay record's subject path and the session-attributed provider selection no longer matched the snapshot copy. Both are display metadata outside the Evidence id; the provider call is what establishes the binding here, so compare the content the id commits to and assert the ids separately, which the test already does. Also apply the formatter to BinarySessionInvestigation.test.ts, which fails format:check on its own. * fix(server): deliver the retained copy that carries the session selection Recording stamps the active session's provider selection onto the ledger copy of a semantic ID. The tools that build or project their own Evidence value then delivered that unattributed copy, so the MCP response and the snapshot export disagreed for the same evidence_id: Ghidra reference and evidence flows, composed workflow overviews, analysis functions and the process capture tools all failed deep-equality against the retained record. Hand the delivered copy the session's selection when the ID is retained. Other retained display metadata, such as a caller path carried by an imported record, stays as the caller built it. * test(investigation): keep the session test within its lint and format limits Two checks on this branch failed for reasons the branch itself introduced: format:check wants the withEvidenceProviderSelection call in UnknownEvidence.ts wrapped at its argument list, which the branch's edit moved off. lint reports max-lines-per-function (152 lines, limit 150) for the "reobserves resource-scoped ..." case after the branch expanded two assertions in it. The provider-selection expectation is a fixed value, so it moves to a module-level constant and the case drops back under the limit without weakening either assertion. * fix(server): carry the session selection on the workflow copy delivered Commit |
||
|
|
9ca9654500 | refactor(ci): share repository identifier validation (#14678) |