From d506a6f6dfe62d85ad2a9b000041caeb233f9e6f Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Mon, 23 Nov 2026 18:03:55 -0500 Subject: [PATCH] docs: tighten contributor guidance and prune duplicated skill text (#14203) * docs: tighten contributor guidance and prune duplicated skill and verification text Link AGENTS.md to the CONTRIBUTING.md owners for scope, issues and pull requests, remove change narratives from the development guides, add a verification-record retention rule, and route format-specific skill entries to tool descriptions and guides instead of restating them. * chore(skill): regenerate the Cursor plugin skill copy The skill source was trimmed in this PR; regenerate the tracked Cursor plugin copy with scripts/generate-cursor-plugin-skill.mjs so the documentation check's freshness test passes. --- .../skills/reverse-engineer-anything/SKILL.md | 355 ++++-------------- .../references/connection-and-recovery.md | 30 +- .../skills/reverse-engineer-anything/SKILL.md | 355 ++++-------------- .../references/connection-and-recovery.md | 30 +- AGENTS.md | 99 +---- CONTRIBUTING.md | 73 ++-- docs/development/client-verification.md | 38 +- docs/development/documentation.md | 5 + docs/development/reconstruction-readiness.md | 10 +- docs/development/releasing.md | 19 +- 10 files changed, 263 insertions(+), 751 deletions(-) diff --git a/.agents/skills/reverse-engineer-anything/SKILL.md b/.agents/skills/reverse-engineer-anything/SKILL.md index d6ce7fcb22..4206de40f9 100644 --- a/.agents/skills/reverse-engineer-anything/SKILL.md +++ b/.agents/skills/reverse-engineer-anything/SKILL.md @@ -34,18 +34,12 @@ Diagnose the observed blocker, continue useful supported work, and resume the original task after repair. Client approval, shell PATH, registration and engine availability have different remedies; avoid repeating setup for all of them. If the host times out without a REA result, do not repeat the unchanged call or -assume work stopped. Read the recovery guide's deadline distinction before retrying. -If the MCP connection drops, retry that call once only when it is safe to -repeat or known not to have started. If it may already have changed the -target, or it fails again, tell the user and ask them to restart the MCP -client. If REA could not start its connection, retry once, then tell the user -and ask them to restart the MCP client. Do not retry a startup failure that -returns the same unchanged result. For plugin installs, follow -[plugin recovery](references/connection-and-recovery.md#rea-installed-as-a-client-plugin). -For setup-owned registrations, run `rea doctor` when REA could not start -or tools stay missing after that restart. For `cleanup_incomplete`, a retryable -capacity limit, or `configuration_invalid`, follow the recovery guide's ladder -before asking for a restart. Read that guide before a second repair attempt. +assume work stopped; read the guide's +[deadline distinction](references/connection-and-recovery.md#distinguish-client-and-server-deadlines). +When the MCP connection drops, REA could not start, or a call returns +`cleanup_incomplete`, a retryable capacity limit or `configuration_invalid`, +follow its [recovery ladder](references/connection-and-recovery.md#recovery-ladder) +before retrying, restarting or repairing. Choose the installation owner before repairing registration. Plugin installs use [plugin recovery](references/connection-and-recovery.md#rea-installed-as-a-client-plugin); @@ -204,266 +198,83 @@ explicit path or endpoint and do not need it. `line_offset` / `line_limit`, or explicit null for all remaining output. Window counts are display lines, not annotations or samples. Preserve source digests across pages. This reads existing files; it does not acquire hardware signals. -- Explicit local WebAssembly artifact: `inspect_wasm_artifact`. Supply WABT 1.0.42 - through `REA_WABT_BIN_DIRECTORY`; retain exact byte/tool identity and decoded WAT. - Select JavaScript glue and candidate paths explicitly and preserve URL/path - ambiguity. No implicit fetch or target execution; WAT is not original source. - See the [WASM guide](https://github.com/morluto/rea/blob/main/docs/guides/wasm/wasm-artifacts.md). -- Explicit local Android APK (or ZIP/AAB) signing: `inspect_apk_signature`. - Prefer its summary or selected signer/digest/lineage page; retain complete - Evidence and use `inspect_analysis_view` kind `apk-signature` for follow-ups. - Reports which schemes are present (v1 JAR, v2, v3, v3.1), each signer's - certificate SHA-256 fingerprint (v1 included, from its PKCS#7 block), v3 key-rotation lineage, source stamp, and - whether each signed digest still matches the bytes (self-consistency). This - is identity and integrity, not a trust or authenticity verdict. - See the [APK signature guide](https://github.com/morluto/rea/blob/main/docs/apk-signature.md). -- Explicit local EVM bytecode carrier: `inspect_evm_interface` with caller-selected - `raw` or `hex` encoding. The owned worker deadline is `timeout_ms` (default - 30000 ms, range 1..2147483647, next call). Select byte, address-space and CPU - allowances separately through `producer_limits`; tighter inherited OS limits - remain enforced, and the 256 MiB worker heap is independent. Preserve - carrier/decoded digests and treat selectors, - argument strings and mutability as inferred candidates; this performs no chain - lookup or target execution. For the complete inferred interface without hex or - duplicate stdout, discover support and select `detail: "summary"`; complete - Evidence stays retained under its original identity. Use the returned - `parent_evidence_id` for exact function or `bytecode_hex`/stdout/stderr pages. - Candidate coverage does not establish interface completeness. See the - [EVM bytecode guide](https://github.com/morluto/rea/blob/main/docs/guides/evm/evm-bytecode.md). -- Embedded Go compiler, module, build-setting metadata, or static `(ptr, len)` - string literals: `inspect_go_binary` with the explicit local file (pass - `include_string_literals: true` and optional `max_string_literals` for bounded - inferred static string-header recovery, and page retained rows with - `inspect_analysis_view` kind `go` collection `string_literals`). This built-in - target-free inspection requires no Go installation or disassembler. Preserve - raw module bytes and source ranges; absent metadata does not prove a binary is - not Go, static string recovery excludes compiler-inlined stack or immediate - strings, and unparsed text records remain explicit. See the - [Go binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/go-binaries.md). -- Embedded CUDA/HIP code objects: `inspect_gpu_code_objects`; inventory targets - first, then decode selected payloads and query retained GPU Evidence. -- Bundled GGUF or safetensors model declarations: `inspect_model_artifact` - with the explicit local file. Default header hashing leaves full-file identity - unknown; `hash: "full"` additionally reads all weights for SHA-256. MCP returns - retained summaries; optional `view` selects one page in the initial call. Use - `inspect_analysis_view` kind `model-artifact` for - batched metadata keys, tensor names or type totals, selected fields and pages. - Preserve header-scoped indices and array preview omissions; do not infer model - behavior from declared architecture or tensor types. See the - [model file guide](https://github.com/morluto/rea/blob/main/docs/model-artifacts.md). -- Unity IL2CPP names, member owners and string literals from `global-metadata.dat`: - `inspect_il2cpp_metadata` with the explicit local file; MCP defaults to compact - counts. Query sections, images, types, methods, fields, properties, events, - parameters or string_literals through `inspect_analysis_view` - with the returned `parent_evidence_id`, using exact filters, batch indices and - selected fields. Parameters accept `method_indices`, avoiding a scan of all - parameter pages. Missing collections in historical Evidence remain unknown. - Versions 24, 27, 29, 31 and 39; no Unity, IL2CPP - binary or disassembler is run. Unrecognized magic (possibly encrypted) and - other versions are unsupported. Optional matching `binary_path` enables static native addresses and type references; query `method_addresses` with indices or addresses/states, preserving every shared-body method and both artifact identities. Without a linked binary native counts remain unknown. Byte-pattern fallback is inferred; no runtime behavior or same-build pairing is proved. See the - [IL2CPP metadata guide](https://github.com/morluto/rea/blob/main/docs/il2cpp-metadata.md). -- Embedded cargo-auditable Rust dependency metadata: `inspect_rust_binary` - with the explicit local ELF, PE, thin Mach-O, or WebAssembly core-module - file. This built-in target-free inspection requires no Rust installation or - disassembler. Preserve package order, dependency indices, and the section file - range. A missing `.dep-v0` section is null metadata, not proof the binary has - no dependencies. A rustc commit hash is an inference from a - `/rustc/<40-hex>/` path in read-only data or a WebAssembly data section. - For selected crates, use `view: {collection: "packages", names: [...], - fields: ["name", "version", "source"]}` on the first call; explicitly include - `dependencies` for direct index references. Use `detail: "summary"` for counts - and ranges, or retained `inspect_analysis_view` Rust package/edge pages for - subsequent filters. Keep the complete parent Evidence accessible; CLI compact - delivery requires `--evidence_output`. - See the - [Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md). -- Maven POM or Gradle module metadata: `inspect_maven_gradle_metadata` with - the explicit local `pom.xml` or `.module` file. This built-in target-free - inspection requires no Maven or Gradle. Preserve coordinates as spelled, - dependency and dependencyManagement rows, BOM imports, Gradle variants and - rich versions, and unresolved property or parent references. Interpolation, - inheritance, tree resolution, and repository access are not performed. See - the - [Maven POM and Gradle module metadata guide](https://github.com/morluto/rea/blob/main/docs/maven-gradle-metadata.md). -- PE Authenticode certificate table: `inspect_pe_certificates` with the explicit - local PE32/PE32+ file. This built-in target-free inspection requires no - Windows SDK. Preserve WIN_CERTIFICATE ranges, types, payload SHA-256, and - PKCS#7 signer/X.509 identity fields, including `subject_key_identifier_hex` - when the signer uses that form. A missing security directory is observed - absence of that table, not proof the image is unsigned in every catalog sense. - Signatures are not verified. See the - [PE certificate guide](https://github.com/morluto/rea/blob/main/docs/pe-certificates.md). -- PE import and delay-load tables: `inspect_pe_imports` with the explicit - local PE32/PE32+ file. This built-in target-free inspection requires no - Windows SDK. Preserve DLL names, named and ordinal functions, ILT/IAT RVAs, - delay-load descriptors, and the pefile import hash of the standard import - table. A missing import directory is observed absence of that table, not - proof the image never imported APIs through another table. Bound snapshots - and loaded IAT contents remain unobserved. See the - [PE import guide](https://github.com/morluto/rea/blob/main/docs/pe-imports.md). -- Windows Shell Link shortcuts: `inspect_windows_shortcut` with the explicit - local `.lnk` file. This built-in target-free inspection requires no Windows - SDK or COM. Preserve header flags and FILETIMEs, IDList items, LinkInfo - volume and network names, StringData arguments and icon location, ExtraData - signatures, and Tracker droid facts labelled derived. Unknown IDList items - and ExtraData signatures stay raw with SHA-256. The target path is not - resolved or executed. See the - [Windows shortcut guide](https://github.com/morluto/rea/blob/main/docs/guides/native/windows-shortcut.md). -- PE TLS callbacks and load configuration: `inspect_pe_load_config` with the - explicit local PE32/PE32+ file. This built-in target-free inspection requires - no Windows SDK. Preserve callback VAs as strings with their RVA, file offset - and section, and the size-covered security cookie, SafeSEH, CFG, - EH-continuation and XFG fields. Guard-flag mitigation claims are inferred - linker declarations, not proof of enforcement. A missing directory is observed - absence of that declaration. See the - [PE load configuration guide](https://github.com/morluto/rea/blob/main/docs/pe-load-config.md). -- ELF, PE, and Mach-O hardening: `inspect_binary_hardening` with the explicit - local file. This built-in target-free inspection requires no pwntools or other - host tool. One image per Mach-O slice. Each property is `enabled`, `disabled`, - `partial`, `unknown`, or `not_applicable`, with the header field or import - behind it. A missing stack-protector or fortify import is `unknown`, not - proof the protection was omitted. Authenticode and Mach-O code signatures - report presence, not validity. Hardened runtime stays unknown and names - `inspect_signature`. The image is not executed. See the - [binary hardening guide](https://github.com/morluto/rea/blob/main/docs/binary-hardening.md). -- ELF note tables: `inspect_elf_notes` with the explicit local ELF32/ELF64 - file. This built-in target-free inspection requires no disassembler. Preserve - PT_NOTE and SHT_NOTE ranges, owners, types, descriptor SHA-256, and GNU - build-id or ABI-tag fields. A missing table is observed absence of those - declarations, not proof the image never carried notes. See the - [ELF notes guide](https://github.com/morluto/rea/blob/main/docs/elf-notes.md). -- DWARF compile units: `inspect_dwarf_units` with the explicit local ELF, - Mach-O, or PE file, or the DWARF file inside a `.dSYM` bundle. This built-in - target-free inspection requires no disassembler. It reads DWARF 2 through 5 - unit headers and the unit DIE: name, compilation directory, producer, - language, and `dwo_name`, including compressed ELF sections. Page with - `offset` and `limit`. Partial coverage means a later unit could not be - framed or a declared `.debug_info` was not read. Absent `.debug_info` - applies to this file only. Per-unit gaps stay in `issues`. Child DIEs, types, - line tables, and location expressions are not read. Universal Mach-O - requires `architecture`. See the - [DWARF compile units guide](https://github.com/morluto/rea/blob/main/docs/guides/native/dwarf-units.md). - -- Separate ELF debug files: `inspect_elf_debug_link` with the explicit local - ELF32/ELF64 file. This built-in target-free inspection requires no - disassembler and does not search for debug files. Preserve the - `.gnu_debuglink` name and CRC32, `.gnu_debugaltlink` build-id, GNU build-id, - and lookup path strings. Those paths are not opened. Pass `candidate_path` - only for one file you already selected; the verdict is matches, - does_not_match, or cannot_verify. A missing section is observed absence only - when section names are complete. The `.gnu_debugdata` xz payload is not - decoded. See the - [ELF debug files guide](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-debug-link.md). - -- ELF load-time dynamic dependencies: `inspect_elf_dependencies` with the - explicit local ELF32/ELF64 `ET_EXEC` or `ET_DYN` file. This built-in - target-free inspection requires no disassembler or dynamic loader. Preserve - ordered `DT_NEEDED` names (duplicates included), `DT_SONAME`, `DT_RPATH` / - `DT_RUNPATH` as written including `$ORIGIN` / `$LIB` / `$PLATFORM` tokens, - decoded `DT_FLAGS` / `DT_FLAGS_1`, `PT_INTERP`, GNU version requirements and - definitions, derived per-namespace maxima, and undefined `.dynsym` imports - joined to `library@version` when known. A missing `PT_DYNAMIC` is an observed - empty inventory, not proof another overlay carried dynamic metadata. - Relocatable objects use `inspect_kernel_module`; core dumps use - `inspect_recorded_crash`. For large inventories prefer `detail: "summary"` - plus `inspect_analysis_view` kind `elf-dependencies`. CLI summary requires - `--evidence_output`. See the - [ELF dependencies guide](https://github.com/morluto/rea/blob/main/docs/elf-dependencies.md). - -- Code that runs before `main` or at exit in ELF or Mach-O: - `inspect_native_initializers` with the explicit local file (and - `architecture` for a universal Mach-O). This built-in inspection requires no - disassembler. Preserve slot and target addresses, the `resolution` of each - entry, and its limitations. An `unresolved` slot is not a zero pointer, and a - missing table is not proof that no constructor exists. See the - [initializer guide](https://github.com/morluto/rea/blob/main/docs/guides/native/native-initializers.md). - -- ELF unwind function ranges: `inspect_elf_unwind_ranges` with the explicit - local ELF32/ELF64 file. This built-in target-free inspection requires no - disassembler. Preserve FDE start, end, size, containing section, exact - symbol name, CIE index, LSDA, and personality. Page with `offset` and - `limit`. A missing `.eh_frame` is observed absence of that declaration, - not proof the image has no functions. `.debug_frame` is reported present - or absent and is not decoded. CFA instructions are counted and not - evaluated. See the - [ELF unwind ranges guide](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-unwind-ranges.md). -- Apple `.ips` crash reports: `inspect_apple_ips` with the explicit local - file. This built-in target-free inspection requires no Xcode, atos, or - pwntools. Preserve first-line metadata, `bug_type` as a string, process and - exception facts, lossless integer registers, usedImages UUIDs, and - documented classification matches. Only `bug_type` `"309"` yields a crash - body; other types, including `"288"` stackshots, return no crash result. - Select an optional `join_path` for UUID-and-architecture matching to one - local Mach-O or dSYM; preserve slice identity and unjoined reasons. Joined - static addresses do not resolve function names or dSYM symbols. See the - [Apple IPS guide](https://github.com/morluto/rea/blob/main/docs/apple-ips.md). -- Linux kernel module metadata: `inspect_kernel_module` with the explicit local - ELF32/ELF64 relocatable file. This built-in target-free inspection requires - no Linux host or `modinfo`. Preserve `.modinfo` key order and duplicate keys, - `__versions` CRC hex, section file ranges, and the appended signature - trailer's PKCS#7 SHA-256. A missing section is observed absence when section - names are known, not proof the module never carried that metadata. - `struct module` is not decoded. The signature is not validated. gzip, xz, and - zstd containers are unsupported; decompress into a separate file with an - external codec utility, then inspect the decompressed `ET_REL` image. See the - [kernel module guide](https://github.com/morluto/rea/blob/main/docs/kernel-modules.md). -- Linux kernel version and build config (`CONFIG_*` options such as - `CONFIG_SECURITY_SELINUX`): `inspect_kernel_build_config` with the explicit - local `vmlinux`, raw `Image`, x86 `bzImage`, or `configs.ko`. This built-in - target-free inspection requires no Linux host or `extract-ikconfig`. Preserve - the banner version, config SHA-256, option count, and value kinds; use `name` - for one option. An `IKCFG_ST` string is a config only with a valid gzip member - and `IKCFG_ED`. An absent config may mean the kernel was built without - `CONFIG_IKCONFIG`. Non-gzip payloads are unsupported; decompress externally, - then inspect the result. See the - [kernel build config guide](https://github.com/morluto/rea/blob/main/docs/guides/native/kernel-build-config.md). -- CPython 3.7–3.15 `.pyc` header, nested marshal code objects and bytecode - identity: `inspect_python_pyc` with the explicit local file. This built-in - target-free inspection requires no Python installation. Preserve magic, - PEP 552 hash or mtime/size, nested names, and bytecode SHA-256. Bytecode is - not decompiled, and a decoded header does not prove the matching `.py` is - present. See the - [CPython pyc guide](https://github.com/morluto/rea/blob/main/docs/python-pyc.md). -- Erlang BEAM IFF container: `inspect_erlang_beam` with the explicit local - `.beam` file. This built-in target-free inspection requires no Erlang - installation. Preserve chunk names, atom order, export/import/lambda tables, - and the Code header. For selected facts, prefer `detail: "summary"` plus a - `beam` view (collection, names/indices, fields and paging), retaining the full - Evidence. CLI summary requires `--evidence_output`. Missing table counts stay - null; decoded empty tables count zero. Bytecode is not executed. See the - [Erlang BEAM guide](https://github.com/morluto/rea/blob/main/docs/erlang-beam.md). -- NuGet `.nupkg` package identity, dependency groups and ZIP inventory: - `inspect_nuget_nupkg` with the explicit local file. This built-in - target-free inspection does not restore the package, execute it, or contact a - feed. Preserve identity fields as present, dependency version ranges as - spelled, and path-derived member roles. Missing, ambiguous, or malformed - `.nuspec` members still return the inventory with limitations. Encrypted - members are listed and not extracted. See the - [NuGet packages guide](https://github.com/morluto/rea/blob/main/docs/guides/managed/nuget-nupkg.md). - -- Explicit local SQLite database snapshot: `inspect_sqlite_database`. Inspect - with Node.js 24.x >=24.15 or 26+ providing native SQLite limits. Read schema - first (compact inventory by default), or select an exact ordinary table - and `columns` when rows are needed. Defaults are selected-table schema and - 20 rows; request `schema_scope: "database"` for the complete stored schema. Preserve both database and existing sibling WAL identity; row samples - report truncation and have unspecified order. Use a quiescent snapshot rather - than assuming a live database/WAL pair was copied atomically. See the - [SQLite guide](https://github.com/morluto/rea/blob/main/docs/guides/data/sqlite-databases.md). -- Explicit Linux ELF file for offline layout, symbols, relocations or static - mitigation evidence: `inspect_binary_layout`. This target-free operation uses - caller-supplied pwntools without opening a disassembler database. Preserve its - raw locations and inference/coverage limits; see the - [offline binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/binary-diagnostics.md). -- Supplied Linux x86-64 ELF core: `inspect_recorded_crash`. Read every recorded - thread, raw note and source-bound register without opening a live target. - Historical PIDs do not select live processes. Request `include_debugger_context` - only when core-only mapping candidates help; see the - [recorded crash guide](https://github.com/morluto/rea/blob/main/docs/guides/native/recorded-crashes.md). -- PE resource type/name/language trees and static icon group references: - `inspect_pe_resources` with an explicit path. This portable operation requires - no active target or engine; opaque payloads retain file ranges and SHA-256. -- PE export directories and ELF dynamic-symbol exports: `inspect_native_exports` - with an explicit path; portable, no active target or engine. +- Explicit local file in a format with a dedicated target-free tool: call that + tool with the file path. These tools need no active target or disassembler + unless their description names a caller-supplied host tool. Their descriptions + state supported layouts, defaults, paging and limits; the linked guides give + the workflow. Prefer `detail: "summary"` with retained `inspect_analysis_view` + pages when the tool offers them and the inventory is large. A missing table or + section is observed absence of that declaration in this file, not proof the + behavior or metadata never existed. + - WebAssembly: `inspect_wasm_artifact` with WABT through + `REA_WABT_BIN_DIRECTORY`; select JavaScript glue and candidate paths + explicitly ([WASM guide](https://github.com/morluto/rea/blob/main/docs/guides/wasm/wasm-artifacts.md)). + - APK, ZIP or AAB signing: `inspect_apk_signature`, identity and integrity + rather than a trust verdict ([APK signature guide](https://github.com/morluto/rea/blob/main/docs/apk-signature.md)). + - EVM bytecode: `inspect_evm_interface`; selectors, arguments and mutability + are inferred candidates ([EVM bytecode guide](https://github.com/morluto/rea/blob/main/docs/guides/evm/evm-bytecode.md)). + - Go build metadata or static `(ptr, len)` strings: `inspect_go_binary` + ([Go binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/go-binaries.md)). + - Rust cargo-auditable dependencies: `inspect_rust_binary`; for selected + crates, pass a `packages` `view` on the first call + ([Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md)). + - Embedded CUDA/HIP code objects: `inspect_gpu_code_objects`; inventory + targets first, then decode selected payloads. + - GGUF or safetensors declarations: `inspect_model_artifact`; do not infer + model behavior from declared architecture or tensor types + ([model file guide](https://github.com/morluto/rea/blob/main/docs/model-artifacts.md)). + - Unity IL2CPP `global-metadata.dat`: `inspect_il2cpp_metadata`; pass the + matching native binary as `binary_path` to link method addresses + ([IL2CPP metadata guide](https://github.com/morluto/rea/blob/main/docs/il2cpp-metadata.md)). + - Maven `pom.xml` or Gradle `.module`: `inspect_maven_gradle_metadata` + ([Maven and Gradle guide](https://github.com/morluto/rea/blob/main/docs/maven-gradle-metadata.md)). + - PE tables: `inspect_pe_certificates`, `inspect_pe_imports`, + `inspect_pe_load_config` and `inspect_pe_resources`; PE or ELF exports: + `inspect_native_exports`. Signatures are not verified + ([certificates](https://github.com/morluto/rea/blob/main/docs/pe-certificates.md), + [imports](https://github.com/morluto/rea/blob/main/docs/pe-imports.md), + [load configuration](https://github.com/morluto/rea/blob/main/docs/pe-load-config.md)). + - Windows `.lnk` shortcut: `inspect_windows_shortcut`; the target is not + resolved ([shortcut guide](https://github.com/morluto/rea/blob/main/docs/guides/native/windows-shortcut.md)). + - ELF, PE and Mach-O hardening: `inspect_binary_hardening`; use + `inspect_signature` for Mach-O hardened runtime + ([hardening guide](https://github.com/morluto/rea/blob/main/docs/binary-hardening.md)). + - ELF declarations: `inspect_elf_notes`, `inspect_elf_debug_link` (pass + `candidate_path` only for a debug file you already selected), + `inspect_elf_dependencies` and `inspect_elf_unwind_ranges`. Relocatable + objects use `inspect_kernel_module`; core dumps use + `inspect_recorded_crash` + ([notes](https://github.com/morluto/rea/blob/main/docs/elf-notes.md), + [debug files](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-debug-link.md), + [dependencies](https://github.com/morluto/rea/blob/main/docs/elf-dependencies.md), + [unwind ranges](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-unwind-ranges.md)). + - DWARF compile units, including the DWARF file inside a `.dSYM`: + `inspect_dwarf_units` ([DWARF guide](https://github.com/morluto/rea/blob/main/docs/guides/native/dwarf-units.md)). + - Code that runs before `main` or at exit in ELF or Mach-O: + `inspect_native_initializers` + ([initializer guide](https://github.com/morluto/rea/blob/main/docs/guides/native/native-initializers.md)). + - Apple `.ips` crash report: `inspect_apple_ips`; `join_path` matches one + local Mach-O or dSYM ([Apple IPS guide](https://github.com/morluto/rea/blob/main/docs/apple-ips.md)). + - Linux kernel module: `inspect_kernel_module`; kernel version and + `CONFIG_*` options: `inspect_kernel_build_config`. Decompress unsupported + containers into a separate file with an external codec, then inspect the + result ([kernel modules](https://github.com/morluto/rea/blob/main/docs/kernel-modules.md), + [kernel build config](https://github.com/morluto/rea/blob/main/docs/guides/native/kernel-build-config.md)). + - CPython `.pyc`: `inspect_python_pyc`; Erlang `.beam`: + `inspect_erlang_beam`; NuGet `.nupkg`: `inspect_nuget_nupkg` + ([pyc](https://github.com/morluto/rea/blob/main/docs/python-pyc.md), + [BEAM](https://github.com/morluto/rea/blob/main/docs/erlang-beam.md), + [NuGet](https://github.com/morluto/rea/blob/main/docs/guides/managed/nuget-nupkg.md)). + - SQLite snapshot: `inspect_sqlite_database`; read the schema first and + supply a quiescent snapshot rather than a live database/WAL pair + ([SQLite guide](https://github.com/morluto/rea/blob/main/docs/guides/data/sqlite-databases.md)). + - Linux ELF layout, symbols, relocations or static mitigations: + `inspect_binary_layout` with caller-supplied pwntools + ([offline binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/binary-diagnostics.md)). + - Linux ELF core: `inspect_recorded_crash`; historical PIDs do not select + live processes. Request `include_debugger_context` only when core-only + mapping candidates help + ([recorded crash guide](https://github.com/morluto/rea/blob/main/docs/guides/native/recorded-crashes.md)). - Native executable, library, or analysis database: `open_binary`, then use focused analysis tools directly; call `binary_overview` when metadata or inventory context is useful and available from the selected provider. If diff --git a/.agents/skills/reverse-engineer-anything/references/connection-and-recovery.md b/.agents/skills/reverse-engineer-anything/references/connection-and-recovery.md index 71028dcf9d..f1e28dcc2e 100644 --- a/.agents/skills/reverse-engineer-anything/references/connection-and-recovery.md +++ b/.agents/skills/reverse-engineer-anything/references/connection-and-recovery.md @@ -15,15 +15,15 @@ does not establish which server an approval wildcard covers. See ## Choose the remedy from the observed failure -| Observation | Meaning and next step | -| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| No REA tools in the active session | If REA was installed as a client plugin, follow the plugin section below. Otherwise inspect registration with `rea doctor --client codex --json`. A skill installation alone does not register MCP. | -| Missing, malformed or stale registration | Prepare a scoped setup plan; apply only authorized changes with backups. | -| Aligned registration, but no connected tools | Restart/reconnect the client. Doctor checks registration; it cannot establish the current agent's connection. Inspect the client's launch error if reconnection fails. | -| MCP connection dropped or REA could not start | If the connection drops, retry that call once only when it is safe to repeat or known not to have started. If it may already have changed the target, or the same failure returns, tell the user REA's connection failed and ask them to restart the MCP client. If REA could not start its connection, retry once, then tell the user and ask them to restart the MCP client. Do not retry a startup failure that returns the same unchanged result. Run `rea doctor` when REA could not start or tools stay missing after restart. Doctor cannot restore a live connection by itself. | -| `MCP tool call requires approval, but approval policy is never` | Codex rejected the call before REA executed it. Do not install an engine or repeat setup to solve this client-policy decision. See the approval section below. | -| REA returns `provider_unavailable` or an unavailable tool entry | Read that operation's provider diagnostics or `binary_session.result.tool_availability`. Expand each group's tool names and inherit the shared client requirements unless overridden. Use the operation's availability, reason, and remediation; a complete tool catalog does not imply every operation is available. Request `{"detail": "complete"}` only for provider diagnostics. | -| `rea` is missing in a child shell, or Node is incompatible | Inspect the actual shell PATH and launcher/runtime. A prefix installation may be absent from a login shell's PATH; this does not establish a broken MCP registration. | +| Observation | Meaning and next step | +| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| No REA tools in the active session | If REA was installed as a client plugin, follow the plugin section below. Otherwise inspect registration with `rea doctor --client codex --json`. A skill installation alone does not register MCP. | +| Missing, malformed or stale registration | Prepare a scoped setup plan; apply only authorized changes with backups. | +| Aligned registration, but no connected tools | Restart/reconnect the client. Doctor checks registration; it cannot establish the current agent's connection. Inspect the client's launch error if reconnection fails. | +| MCP connection dropped or REA could not start | Follow the [recovery ladder](#recovery-ladder). Doctor cannot restore a live connection by itself. | +| `MCP tool call requires approval, but approval policy is never` | Codex rejected the call before REA executed it. Do not install an engine or repeat setup to solve this client-policy decision. See the approval section below. | +| REA returns `provider_unavailable` or an unavailable tool entry | Read that operation's provider diagnostics or `binary_session.result.tool_availability`. Expand each group's tool names and inherit the shared client requirements unless overridden. Use the operation's availability, reason, and remediation; a complete tool catalog does not imply every operation is available. Request `{"detail": "complete"}` only for provider diagnostics. | +| `rea` is missing in a child shell, or Node is incompatible | Inspect the actual shell PATH and launcher/runtime. A prefix installation may be absent from a login shell's PATH; this does not establish a broken MCP registration. | If the client cannot launch its shell/sandbox helper or read the installed skill, inspect its launch diagnostic. For example, Codex can refuse helper aliases when @@ -60,14 +60,10 @@ When configuration is not editable, report the setting needed or use an authorized CLI fallback. Do not silently broaden permissions or switch targets. A returned REA `provider_timeout` instead means the **server/provider** reached -its deadline. Follow its `remediation.action`, reuse accessible partial Evidence, -and resolve reported incomplete cleanup before retrying. Change a request -field or a `REA_*` setting only when the returned remediation explicitly -recommends that change. Restart REA when that text says the value is read at -startup. A mention that a control does not raise the deadline is not a -recommendation to change it. Do not invent a setting the remediation does not -name. Raising only the client deadline does not change -this server budget. For static JavaScript, +its deadline. Follow its `remediation.action` under the +[recovery ladder](#recovery-ladder) rules, reuse accessible partial Evidence, +and resolve reported incomplete cleanup before retrying. Raising only the client +deadline does not change this server budget. For static JavaScript, `analysis_timeout_ms` (CLI `rea analyze-javascript-application --analysis-timeout-ms `) controls each source's startup, analysis and transfer deadline in **milliseconds**. Increase that diff --git a/.cursor-plugin/skills/reverse-engineer-anything/SKILL.md b/.cursor-plugin/skills/reverse-engineer-anything/SKILL.md index d6ce7fcb22..4206de40f9 100644 --- a/.cursor-plugin/skills/reverse-engineer-anything/SKILL.md +++ b/.cursor-plugin/skills/reverse-engineer-anything/SKILL.md @@ -34,18 +34,12 @@ Diagnose the observed blocker, continue useful supported work, and resume the original task after repair. Client approval, shell PATH, registration and engine availability have different remedies; avoid repeating setup for all of them. If the host times out without a REA result, do not repeat the unchanged call or -assume work stopped. Read the recovery guide's deadline distinction before retrying. -If the MCP connection drops, retry that call once only when it is safe to -repeat or known not to have started. If it may already have changed the -target, or it fails again, tell the user and ask them to restart the MCP -client. If REA could not start its connection, retry once, then tell the user -and ask them to restart the MCP client. Do not retry a startup failure that -returns the same unchanged result. For plugin installs, follow -[plugin recovery](references/connection-and-recovery.md#rea-installed-as-a-client-plugin). -For setup-owned registrations, run `rea doctor` when REA could not start -or tools stay missing after that restart. For `cleanup_incomplete`, a retryable -capacity limit, or `configuration_invalid`, follow the recovery guide's ladder -before asking for a restart. Read that guide before a second repair attempt. +assume work stopped; read the guide's +[deadline distinction](references/connection-and-recovery.md#distinguish-client-and-server-deadlines). +When the MCP connection drops, REA could not start, or a call returns +`cleanup_incomplete`, a retryable capacity limit or `configuration_invalid`, +follow its [recovery ladder](references/connection-and-recovery.md#recovery-ladder) +before retrying, restarting or repairing. Choose the installation owner before repairing registration. Plugin installs use [plugin recovery](references/connection-and-recovery.md#rea-installed-as-a-client-plugin); @@ -204,266 +198,83 @@ explicit path or endpoint and do not need it. `line_offset` / `line_limit`, or explicit null for all remaining output. Window counts are display lines, not annotations or samples. Preserve source digests across pages. This reads existing files; it does not acquire hardware signals. -- Explicit local WebAssembly artifact: `inspect_wasm_artifact`. Supply WABT 1.0.42 - through `REA_WABT_BIN_DIRECTORY`; retain exact byte/tool identity and decoded WAT. - Select JavaScript glue and candidate paths explicitly and preserve URL/path - ambiguity. No implicit fetch or target execution; WAT is not original source. - See the [WASM guide](https://github.com/morluto/rea/blob/main/docs/guides/wasm/wasm-artifacts.md). -- Explicit local Android APK (or ZIP/AAB) signing: `inspect_apk_signature`. - Prefer its summary or selected signer/digest/lineage page; retain complete - Evidence and use `inspect_analysis_view` kind `apk-signature` for follow-ups. - Reports which schemes are present (v1 JAR, v2, v3, v3.1), each signer's - certificate SHA-256 fingerprint (v1 included, from its PKCS#7 block), v3 key-rotation lineage, source stamp, and - whether each signed digest still matches the bytes (self-consistency). This - is identity and integrity, not a trust or authenticity verdict. - See the [APK signature guide](https://github.com/morluto/rea/blob/main/docs/apk-signature.md). -- Explicit local EVM bytecode carrier: `inspect_evm_interface` with caller-selected - `raw` or `hex` encoding. The owned worker deadline is `timeout_ms` (default - 30000 ms, range 1..2147483647, next call). Select byte, address-space and CPU - allowances separately through `producer_limits`; tighter inherited OS limits - remain enforced, and the 256 MiB worker heap is independent. Preserve - carrier/decoded digests and treat selectors, - argument strings and mutability as inferred candidates; this performs no chain - lookup or target execution. For the complete inferred interface without hex or - duplicate stdout, discover support and select `detail: "summary"`; complete - Evidence stays retained under its original identity. Use the returned - `parent_evidence_id` for exact function or `bytecode_hex`/stdout/stderr pages. - Candidate coverage does not establish interface completeness. See the - [EVM bytecode guide](https://github.com/morluto/rea/blob/main/docs/guides/evm/evm-bytecode.md). -- Embedded Go compiler, module, build-setting metadata, or static `(ptr, len)` - string literals: `inspect_go_binary` with the explicit local file (pass - `include_string_literals: true` and optional `max_string_literals` for bounded - inferred static string-header recovery, and page retained rows with - `inspect_analysis_view` kind `go` collection `string_literals`). This built-in - target-free inspection requires no Go installation or disassembler. Preserve - raw module bytes and source ranges; absent metadata does not prove a binary is - not Go, static string recovery excludes compiler-inlined stack or immediate - strings, and unparsed text records remain explicit. See the - [Go binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/go-binaries.md). -- Embedded CUDA/HIP code objects: `inspect_gpu_code_objects`; inventory targets - first, then decode selected payloads and query retained GPU Evidence. -- Bundled GGUF or safetensors model declarations: `inspect_model_artifact` - with the explicit local file. Default header hashing leaves full-file identity - unknown; `hash: "full"` additionally reads all weights for SHA-256. MCP returns - retained summaries; optional `view` selects one page in the initial call. Use - `inspect_analysis_view` kind `model-artifact` for - batched metadata keys, tensor names or type totals, selected fields and pages. - Preserve header-scoped indices and array preview omissions; do not infer model - behavior from declared architecture or tensor types. See the - [model file guide](https://github.com/morluto/rea/blob/main/docs/model-artifacts.md). -- Unity IL2CPP names, member owners and string literals from `global-metadata.dat`: - `inspect_il2cpp_metadata` with the explicit local file; MCP defaults to compact - counts. Query sections, images, types, methods, fields, properties, events, - parameters or string_literals through `inspect_analysis_view` - with the returned `parent_evidence_id`, using exact filters, batch indices and - selected fields. Parameters accept `method_indices`, avoiding a scan of all - parameter pages. Missing collections in historical Evidence remain unknown. - Versions 24, 27, 29, 31 and 39; no Unity, IL2CPP - binary or disassembler is run. Unrecognized magic (possibly encrypted) and - other versions are unsupported. Optional matching `binary_path` enables static native addresses and type references; query `method_addresses` with indices or addresses/states, preserving every shared-body method and both artifact identities. Without a linked binary native counts remain unknown. Byte-pattern fallback is inferred; no runtime behavior or same-build pairing is proved. See the - [IL2CPP metadata guide](https://github.com/morluto/rea/blob/main/docs/il2cpp-metadata.md). -- Embedded cargo-auditable Rust dependency metadata: `inspect_rust_binary` - with the explicit local ELF, PE, thin Mach-O, or WebAssembly core-module - file. This built-in target-free inspection requires no Rust installation or - disassembler. Preserve package order, dependency indices, and the section file - range. A missing `.dep-v0` section is null metadata, not proof the binary has - no dependencies. A rustc commit hash is an inference from a - `/rustc/<40-hex>/` path in read-only data or a WebAssembly data section. - For selected crates, use `view: {collection: "packages", names: [...], - fields: ["name", "version", "source"]}` on the first call; explicitly include - `dependencies` for direct index references. Use `detail: "summary"` for counts - and ranges, or retained `inspect_analysis_view` Rust package/edge pages for - subsequent filters. Keep the complete parent Evidence accessible; CLI compact - delivery requires `--evidence_output`. - See the - [Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md). -- Maven POM or Gradle module metadata: `inspect_maven_gradle_metadata` with - the explicit local `pom.xml` or `.module` file. This built-in target-free - inspection requires no Maven or Gradle. Preserve coordinates as spelled, - dependency and dependencyManagement rows, BOM imports, Gradle variants and - rich versions, and unresolved property or parent references. Interpolation, - inheritance, tree resolution, and repository access are not performed. See - the - [Maven POM and Gradle module metadata guide](https://github.com/morluto/rea/blob/main/docs/maven-gradle-metadata.md). -- PE Authenticode certificate table: `inspect_pe_certificates` with the explicit - local PE32/PE32+ file. This built-in target-free inspection requires no - Windows SDK. Preserve WIN_CERTIFICATE ranges, types, payload SHA-256, and - PKCS#7 signer/X.509 identity fields, including `subject_key_identifier_hex` - when the signer uses that form. A missing security directory is observed - absence of that table, not proof the image is unsigned in every catalog sense. - Signatures are not verified. See the - [PE certificate guide](https://github.com/morluto/rea/blob/main/docs/pe-certificates.md). -- PE import and delay-load tables: `inspect_pe_imports` with the explicit - local PE32/PE32+ file. This built-in target-free inspection requires no - Windows SDK. Preserve DLL names, named and ordinal functions, ILT/IAT RVAs, - delay-load descriptors, and the pefile import hash of the standard import - table. A missing import directory is observed absence of that table, not - proof the image never imported APIs through another table. Bound snapshots - and loaded IAT contents remain unobserved. See the - [PE import guide](https://github.com/morluto/rea/blob/main/docs/pe-imports.md). -- Windows Shell Link shortcuts: `inspect_windows_shortcut` with the explicit - local `.lnk` file. This built-in target-free inspection requires no Windows - SDK or COM. Preserve header flags and FILETIMEs, IDList items, LinkInfo - volume and network names, StringData arguments and icon location, ExtraData - signatures, and Tracker droid facts labelled derived. Unknown IDList items - and ExtraData signatures stay raw with SHA-256. The target path is not - resolved or executed. See the - [Windows shortcut guide](https://github.com/morluto/rea/blob/main/docs/guides/native/windows-shortcut.md). -- PE TLS callbacks and load configuration: `inspect_pe_load_config` with the - explicit local PE32/PE32+ file. This built-in target-free inspection requires - no Windows SDK. Preserve callback VAs as strings with their RVA, file offset - and section, and the size-covered security cookie, SafeSEH, CFG, - EH-continuation and XFG fields. Guard-flag mitigation claims are inferred - linker declarations, not proof of enforcement. A missing directory is observed - absence of that declaration. See the - [PE load configuration guide](https://github.com/morluto/rea/blob/main/docs/pe-load-config.md). -- ELF, PE, and Mach-O hardening: `inspect_binary_hardening` with the explicit - local file. This built-in target-free inspection requires no pwntools or other - host tool. One image per Mach-O slice. Each property is `enabled`, `disabled`, - `partial`, `unknown`, or `not_applicable`, with the header field or import - behind it. A missing stack-protector or fortify import is `unknown`, not - proof the protection was omitted. Authenticode and Mach-O code signatures - report presence, not validity. Hardened runtime stays unknown and names - `inspect_signature`. The image is not executed. See the - [binary hardening guide](https://github.com/morluto/rea/blob/main/docs/binary-hardening.md). -- ELF note tables: `inspect_elf_notes` with the explicit local ELF32/ELF64 - file. This built-in target-free inspection requires no disassembler. Preserve - PT_NOTE and SHT_NOTE ranges, owners, types, descriptor SHA-256, and GNU - build-id or ABI-tag fields. A missing table is observed absence of those - declarations, not proof the image never carried notes. See the - [ELF notes guide](https://github.com/morluto/rea/blob/main/docs/elf-notes.md). -- DWARF compile units: `inspect_dwarf_units` with the explicit local ELF, - Mach-O, or PE file, or the DWARF file inside a `.dSYM` bundle. This built-in - target-free inspection requires no disassembler. It reads DWARF 2 through 5 - unit headers and the unit DIE: name, compilation directory, producer, - language, and `dwo_name`, including compressed ELF sections. Page with - `offset` and `limit`. Partial coverage means a later unit could not be - framed or a declared `.debug_info` was not read. Absent `.debug_info` - applies to this file only. Per-unit gaps stay in `issues`. Child DIEs, types, - line tables, and location expressions are not read. Universal Mach-O - requires `architecture`. See the - [DWARF compile units guide](https://github.com/morluto/rea/blob/main/docs/guides/native/dwarf-units.md). - -- Separate ELF debug files: `inspect_elf_debug_link` with the explicit local - ELF32/ELF64 file. This built-in target-free inspection requires no - disassembler and does not search for debug files. Preserve the - `.gnu_debuglink` name and CRC32, `.gnu_debugaltlink` build-id, GNU build-id, - and lookup path strings. Those paths are not opened. Pass `candidate_path` - only for one file you already selected; the verdict is matches, - does_not_match, or cannot_verify. A missing section is observed absence only - when section names are complete. The `.gnu_debugdata` xz payload is not - decoded. See the - [ELF debug files guide](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-debug-link.md). - -- ELF load-time dynamic dependencies: `inspect_elf_dependencies` with the - explicit local ELF32/ELF64 `ET_EXEC` or `ET_DYN` file. This built-in - target-free inspection requires no disassembler or dynamic loader. Preserve - ordered `DT_NEEDED` names (duplicates included), `DT_SONAME`, `DT_RPATH` / - `DT_RUNPATH` as written including `$ORIGIN` / `$LIB` / `$PLATFORM` tokens, - decoded `DT_FLAGS` / `DT_FLAGS_1`, `PT_INTERP`, GNU version requirements and - definitions, derived per-namespace maxima, and undefined `.dynsym` imports - joined to `library@version` when known. A missing `PT_DYNAMIC` is an observed - empty inventory, not proof another overlay carried dynamic metadata. - Relocatable objects use `inspect_kernel_module`; core dumps use - `inspect_recorded_crash`. For large inventories prefer `detail: "summary"` - plus `inspect_analysis_view` kind `elf-dependencies`. CLI summary requires - `--evidence_output`. See the - [ELF dependencies guide](https://github.com/morluto/rea/blob/main/docs/elf-dependencies.md). - -- Code that runs before `main` or at exit in ELF or Mach-O: - `inspect_native_initializers` with the explicit local file (and - `architecture` for a universal Mach-O). This built-in inspection requires no - disassembler. Preserve slot and target addresses, the `resolution` of each - entry, and its limitations. An `unresolved` slot is not a zero pointer, and a - missing table is not proof that no constructor exists. See the - [initializer guide](https://github.com/morluto/rea/blob/main/docs/guides/native/native-initializers.md). - -- ELF unwind function ranges: `inspect_elf_unwind_ranges` with the explicit - local ELF32/ELF64 file. This built-in target-free inspection requires no - disassembler. Preserve FDE start, end, size, containing section, exact - symbol name, CIE index, LSDA, and personality. Page with `offset` and - `limit`. A missing `.eh_frame` is observed absence of that declaration, - not proof the image has no functions. `.debug_frame` is reported present - or absent and is not decoded. CFA instructions are counted and not - evaluated. See the - [ELF unwind ranges guide](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-unwind-ranges.md). -- Apple `.ips` crash reports: `inspect_apple_ips` with the explicit local - file. This built-in target-free inspection requires no Xcode, atos, or - pwntools. Preserve first-line metadata, `bug_type` as a string, process and - exception facts, lossless integer registers, usedImages UUIDs, and - documented classification matches. Only `bug_type` `"309"` yields a crash - body; other types, including `"288"` stackshots, return no crash result. - Select an optional `join_path` for UUID-and-architecture matching to one - local Mach-O or dSYM; preserve slice identity and unjoined reasons. Joined - static addresses do not resolve function names or dSYM symbols. See the - [Apple IPS guide](https://github.com/morluto/rea/blob/main/docs/apple-ips.md). -- Linux kernel module metadata: `inspect_kernel_module` with the explicit local - ELF32/ELF64 relocatable file. This built-in target-free inspection requires - no Linux host or `modinfo`. Preserve `.modinfo` key order and duplicate keys, - `__versions` CRC hex, section file ranges, and the appended signature - trailer's PKCS#7 SHA-256. A missing section is observed absence when section - names are known, not proof the module never carried that metadata. - `struct module` is not decoded. The signature is not validated. gzip, xz, and - zstd containers are unsupported; decompress into a separate file with an - external codec utility, then inspect the decompressed `ET_REL` image. See the - [kernel module guide](https://github.com/morluto/rea/blob/main/docs/kernel-modules.md). -- Linux kernel version and build config (`CONFIG_*` options such as - `CONFIG_SECURITY_SELINUX`): `inspect_kernel_build_config` with the explicit - local `vmlinux`, raw `Image`, x86 `bzImage`, or `configs.ko`. This built-in - target-free inspection requires no Linux host or `extract-ikconfig`. Preserve - the banner version, config SHA-256, option count, and value kinds; use `name` - for one option. An `IKCFG_ST` string is a config only with a valid gzip member - and `IKCFG_ED`. An absent config may mean the kernel was built without - `CONFIG_IKCONFIG`. Non-gzip payloads are unsupported; decompress externally, - then inspect the result. See the - [kernel build config guide](https://github.com/morluto/rea/blob/main/docs/guides/native/kernel-build-config.md). -- CPython 3.7–3.15 `.pyc` header, nested marshal code objects and bytecode - identity: `inspect_python_pyc` with the explicit local file. This built-in - target-free inspection requires no Python installation. Preserve magic, - PEP 552 hash or mtime/size, nested names, and bytecode SHA-256. Bytecode is - not decompiled, and a decoded header does not prove the matching `.py` is - present. See the - [CPython pyc guide](https://github.com/morluto/rea/blob/main/docs/python-pyc.md). -- Erlang BEAM IFF container: `inspect_erlang_beam` with the explicit local - `.beam` file. This built-in target-free inspection requires no Erlang - installation. Preserve chunk names, atom order, export/import/lambda tables, - and the Code header. For selected facts, prefer `detail: "summary"` plus a - `beam` view (collection, names/indices, fields and paging), retaining the full - Evidence. CLI summary requires `--evidence_output`. Missing table counts stay - null; decoded empty tables count zero. Bytecode is not executed. See the - [Erlang BEAM guide](https://github.com/morluto/rea/blob/main/docs/erlang-beam.md). -- NuGet `.nupkg` package identity, dependency groups and ZIP inventory: - `inspect_nuget_nupkg` with the explicit local file. This built-in - target-free inspection does not restore the package, execute it, or contact a - feed. Preserve identity fields as present, dependency version ranges as - spelled, and path-derived member roles. Missing, ambiguous, or malformed - `.nuspec` members still return the inventory with limitations. Encrypted - members are listed and not extracted. See the - [NuGet packages guide](https://github.com/morluto/rea/blob/main/docs/guides/managed/nuget-nupkg.md). - -- Explicit local SQLite database snapshot: `inspect_sqlite_database`. Inspect - with Node.js 24.x >=24.15 or 26+ providing native SQLite limits. Read schema - first (compact inventory by default), or select an exact ordinary table - and `columns` when rows are needed. Defaults are selected-table schema and - 20 rows; request `schema_scope: "database"` for the complete stored schema. Preserve both database and existing sibling WAL identity; row samples - report truncation and have unspecified order. Use a quiescent snapshot rather - than assuming a live database/WAL pair was copied atomically. See the - [SQLite guide](https://github.com/morluto/rea/blob/main/docs/guides/data/sqlite-databases.md). -- Explicit Linux ELF file for offline layout, symbols, relocations or static - mitigation evidence: `inspect_binary_layout`. This target-free operation uses - caller-supplied pwntools without opening a disassembler database. Preserve its - raw locations and inference/coverage limits; see the - [offline binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/binary-diagnostics.md). -- Supplied Linux x86-64 ELF core: `inspect_recorded_crash`. Read every recorded - thread, raw note and source-bound register without opening a live target. - Historical PIDs do not select live processes. Request `include_debugger_context` - only when core-only mapping candidates help; see the - [recorded crash guide](https://github.com/morluto/rea/blob/main/docs/guides/native/recorded-crashes.md). -- PE resource type/name/language trees and static icon group references: - `inspect_pe_resources` with an explicit path. This portable operation requires - no active target or engine; opaque payloads retain file ranges and SHA-256. -- PE export directories and ELF dynamic-symbol exports: `inspect_native_exports` - with an explicit path; portable, no active target or engine. +- Explicit local file in a format with a dedicated target-free tool: call that + tool with the file path. These tools need no active target or disassembler + unless their description names a caller-supplied host tool. Their descriptions + state supported layouts, defaults, paging and limits; the linked guides give + the workflow. Prefer `detail: "summary"` with retained `inspect_analysis_view` + pages when the tool offers them and the inventory is large. A missing table or + section is observed absence of that declaration in this file, not proof the + behavior or metadata never existed. + - WebAssembly: `inspect_wasm_artifact` with WABT through + `REA_WABT_BIN_DIRECTORY`; select JavaScript glue and candidate paths + explicitly ([WASM guide](https://github.com/morluto/rea/blob/main/docs/guides/wasm/wasm-artifacts.md)). + - APK, ZIP or AAB signing: `inspect_apk_signature`, identity and integrity + rather than a trust verdict ([APK signature guide](https://github.com/morluto/rea/blob/main/docs/apk-signature.md)). + - EVM bytecode: `inspect_evm_interface`; selectors, arguments and mutability + are inferred candidates ([EVM bytecode guide](https://github.com/morluto/rea/blob/main/docs/guides/evm/evm-bytecode.md)). + - Go build metadata or static `(ptr, len)` strings: `inspect_go_binary` + ([Go binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/go-binaries.md)). + - Rust cargo-auditable dependencies: `inspect_rust_binary`; for selected + crates, pass a `packages` `view` on the first call + ([Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md)). + - Embedded CUDA/HIP code objects: `inspect_gpu_code_objects`; inventory + targets first, then decode selected payloads. + - GGUF or safetensors declarations: `inspect_model_artifact`; do not infer + model behavior from declared architecture or tensor types + ([model file guide](https://github.com/morluto/rea/blob/main/docs/model-artifacts.md)). + - Unity IL2CPP `global-metadata.dat`: `inspect_il2cpp_metadata`; pass the + matching native binary as `binary_path` to link method addresses + ([IL2CPP metadata guide](https://github.com/morluto/rea/blob/main/docs/il2cpp-metadata.md)). + - Maven `pom.xml` or Gradle `.module`: `inspect_maven_gradle_metadata` + ([Maven and Gradle guide](https://github.com/morluto/rea/blob/main/docs/maven-gradle-metadata.md)). + - PE tables: `inspect_pe_certificates`, `inspect_pe_imports`, + `inspect_pe_load_config` and `inspect_pe_resources`; PE or ELF exports: + `inspect_native_exports`. Signatures are not verified + ([certificates](https://github.com/morluto/rea/blob/main/docs/pe-certificates.md), + [imports](https://github.com/morluto/rea/blob/main/docs/pe-imports.md), + [load configuration](https://github.com/morluto/rea/blob/main/docs/pe-load-config.md)). + - Windows `.lnk` shortcut: `inspect_windows_shortcut`; the target is not + resolved ([shortcut guide](https://github.com/morluto/rea/blob/main/docs/guides/native/windows-shortcut.md)). + - ELF, PE and Mach-O hardening: `inspect_binary_hardening`; use + `inspect_signature` for Mach-O hardened runtime + ([hardening guide](https://github.com/morluto/rea/blob/main/docs/binary-hardening.md)). + - ELF declarations: `inspect_elf_notes`, `inspect_elf_debug_link` (pass + `candidate_path` only for a debug file you already selected), + `inspect_elf_dependencies` and `inspect_elf_unwind_ranges`. Relocatable + objects use `inspect_kernel_module`; core dumps use + `inspect_recorded_crash` + ([notes](https://github.com/morluto/rea/blob/main/docs/elf-notes.md), + [debug files](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-debug-link.md), + [dependencies](https://github.com/morluto/rea/blob/main/docs/elf-dependencies.md), + [unwind ranges](https://github.com/morluto/rea/blob/main/docs/guides/native/elf-unwind-ranges.md)). + - DWARF compile units, including the DWARF file inside a `.dSYM`: + `inspect_dwarf_units` ([DWARF guide](https://github.com/morluto/rea/blob/main/docs/guides/native/dwarf-units.md)). + - Code that runs before `main` or at exit in ELF or Mach-O: + `inspect_native_initializers` + ([initializer guide](https://github.com/morluto/rea/blob/main/docs/guides/native/native-initializers.md)). + - Apple `.ips` crash report: `inspect_apple_ips`; `join_path` matches one + local Mach-O or dSYM ([Apple IPS guide](https://github.com/morluto/rea/blob/main/docs/apple-ips.md)). + - Linux kernel module: `inspect_kernel_module`; kernel version and + `CONFIG_*` options: `inspect_kernel_build_config`. Decompress unsupported + containers into a separate file with an external codec, then inspect the + result ([kernel modules](https://github.com/morluto/rea/blob/main/docs/kernel-modules.md), + [kernel build config](https://github.com/morluto/rea/blob/main/docs/guides/native/kernel-build-config.md)). + - CPython `.pyc`: `inspect_python_pyc`; Erlang `.beam`: + `inspect_erlang_beam`; NuGet `.nupkg`: `inspect_nuget_nupkg` + ([pyc](https://github.com/morluto/rea/blob/main/docs/python-pyc.md), + [BEAM](https://github.com/morluto/rea/blob/main/docs/erlang-beam.md), + [NuGet](https://github.com/morluto/rea/blob/main/docs/guides/managed/nuget-nupkg.md)). + - SQLite snapshot: `inspect_sqlite_database`; read the schema first and + supply a quiescent snapshot rather than a live database/WAL pair + ([SQLite guide](https://github.com/morluto/rea/blob/main/docs/guides/data/sqlite-databases.md)). + - Linux ELF layout, symbols, relocations or static mitigations: + `inspect_binary_layout` with caller-supplied pwntools + ([offline binary guide](https://github.com/morluto/rea/blob/main/docs/guides/native/binary-diagnostics.md)). + - Linux ELF core: `inspect_recorded_crash`; historical PIDs do not select + live processes. Request `include_debugger_context` only when core-only + mapping candidates help + ([recorded crash guide](https://github.com/morluto/rea/blob/main/docs/guides/native/recorded-crashes.md)). - Native executable, library, or analysis database: `open_binary`, then use focused analysis tools directly; call `binary_overview` when metadata or inventory context is useful and available from the selected provider. If diff --git a/.cursor-plugin/skills/reverse-engineer-anything/references/connection-and-recovery.md b/.cursor-plugin/skills/reverse-engineer-anything/references/connection-and-recovery.md index 71028dcf9d..f1e28dcc2e 100644 --- a/.cursor-plugin/skills/reverse-engineer-anything/references/connection-and-recovery.md +++ b/.cursor-plugin/skills/reverse-engineer-anything/references/connection-and-recovery.md @@ -15,15 +15,15 @@ does not establish which server an approval wildcard covers. See ## Choose the remedy from the observed failure -| Observation | Meaning and next step | -| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| No REA tools in the active session | If REA was installed as a client plugin, follow the plugin section below. Otherwise inspect registration with `rea doctor --client codex --json`. A skill installation alone does not register MCP. | -| Missing, malformed or stale registration | Prepare a scoped setup plan; apply only authorized changes with backups. | -| Aligned registration, but no connected tools | Restart/reconnect the client. Doctor checks registration; it cannot establish the current agent's connection. Inspect the client's launch error if reconnection fails. | -| MCP connection dropped or REA could not start | If the connection drops, retry that call once only when it is safe to repeat or known not to have started. If it may already have changed the target, or the same failure returns, tell the user REA's connection failed and ask them to restart the MCP client. If REA could not start its connection, retry once, then tell the user and ask them to restart the MCP client. Do not retry a startup failure that returns the same unchanged result. Run `rea doctor` when REA could not start or tools stay missing after restart. Doctor cannot restore a live connection by itself. | -| `MCP tool call requires approval, but approval policy is never` | Codex rejected the call before REA executed it. Do not install an engine or repeat setup to solve this client-policy decision. See the approval section below. | -| REA returns `provider_unavailable` or an unavailable tool entry | Read that operation's provider diagnostics or `binary_session.result.tool_availability`. Expand each group's tool names and inherit the shared client requirements unless overridden. Use the operation's availability, reason, and remediation; a complete tool catalog does not imply every operation is available. Request `{"detail": "complete"}` only for provider diagnostics. | -| `rea` is missing in a child shell, or Node is incompatible | Inspect the actual shell PATH and launcher/runtime. A prefix installation may be absent from a login shell's PATH; this does not establish a broken MCP registration. | +| Observation | Meaning and next step | +| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| No REA tools in the active session | If REA was installed as a client plugin, follow the plugin section below. Otherwise inspect registration with `rea doctor --client codex --json`. A skill installation alone does not register MCP. | +| Missing, malformed or stale registration | Prepare a scoped setup plan; apply only authorized changes with backups. | +| Aligned registration, but no connected tools | Restart/reconnect the client. Doctor checks registration; it cannot establish the current agent's connection. Inspect the client's launch error if reconnection fails. | +| MCP connection dropped or REA could not start | Follow the [recovery ladder](#recovery-ladder). Doctor cannot restore a live connection by itself. | +| `MCP tool call requires approval, but approval policy is never` | Codex rejected the call before REA executed it. Do not install an engine or repeat setup to solve this client-policy decision. See the approval section below. | +| REA returns `provider_unavailable` or an unavailable tool entry | Read that operation's provider diagnostics or `binary_session.result.tool_availability`. Expand each group's tool names and inherit the shared client requirements unless overridden. Use the operation's availability, reason, and remediation; a complete tool catalog does not imply every operation is available. Request `{"detail": "complete"}` only for provider diagnostics. | +| `rea` is missing in a child shell, or Node is incompatible | Inspect the actual shell PATH and launcher/runtime. A prefix installation may be absent from a login shell's PATH; this does not establish a broken MCP registration. | If the client cannot launch its shell/sandbox helper or read the installed skill, inspect its launch diagnostic. For example, Codex can refuse helper aliases when @@ -60,14 +60,10 @@ When configuration is not editable, report the setting needed or use an authorized CLI fallback. Do not silently broaden permissions or switch targets. A returned REA `provider_timeout` instead means the **server/provider** reached -its deadline. Follow its `remediation.action`, reuse accessible partial Evidence, -and resolve reported incomplete cleanup before retrying. Change a request -field or a `REA_*` setting only when the returned remediation explicitly -recommends that change. Restart REA when that text says the value is read at -startup. A mention that a control does not raise the deadline is not a -recommendation to change it. Do not invent a setting the remediation does not -name. Raising only the client deadline does not change -this server budget. For static JavaScript, +its deadline. Follow its `remediation.action` under the +[recovery ladder](#recovery-ladder) rules, reuse accessible partial Evidence, +and resolve reported incomplete cleanup before retrying. Raising only the client +deadline does not change this server budget. For static JavaScript, `analysis_timeout_ms` (CLI `rea analyze-javascript-application --analysis-timeout-ms `) controls each source's startup, analysis and transfer deadline in **milliseconds**. Increase that diff --git a/AGENTS.md b/AGENTS.md index 917a6825ef..2dd0369df6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,11 +4,11 @@ REA is a local-only reverse-engineering tool with shared CLI/MCP workflows. Distinguish observations, derivations, inferences, and unknowns; preserve Evidence provenance and session semantics through both adapters. Provider support and setup live in [README.md](README.md#choosing-a-deep-analysis-provider) and its linked guides. -Follow the [contribution scope and fail-closed integration rule](CONTRIBUTING.md#contribution-scope). Do not integrate capabilities while material scope, authority, side-effect, or required verification questions remain unresolved. For new providers or capabilities involving target execution, injection, mutation, or protection recovery, seek the required maintainer scope decision before substantial implementation for integration. Welcome early proposals, small exploratory prototypes, and draft PRs that help resolve questions; they do not authorize integration. +Follow the [contribution scope](CONTRIBUTING.md#contribution-scope) and [fail-closed integration rule](CONTRIBUTING.md#fail-closed-integration), including the maintainer scope decision required before substantial implementation of a new provider or of target execution, injection, mutation, or protection recovery. Ghidra uses ephemeral databases without modifying executable bytes or controlling a GUI; Windows Ghidra P0 has no mutation authority. IDA analysis is read-only; never save or close an attached GUI database. -Configuration changes must be additive and idempotent, with backups. Installers must not install or upgrade unrelated software, including Homebrew, Node.js, npm, Java, or Ghidra. Ghidra and IDA are bring-your-own. `rea setup` must show its planned changes and require approval before writing files or installing Hopper. +Configuration changes must be additive and idempotent, with backups. Installers must not install or upgrade unrelated software, including Homebrew, Node.js, npm, Java, or Ghidra; Ghidra and IDA are bring-your-own. `rea setup` must show its planned changes and require approval before writing files or installing Hopper. Preserve caller-selected inputs and local evidence, including output, URLs, paths, digests, and metadata. Redact transport authentication credentials and explicitly marked sensitive values; do not infer secrecy from names or text patterns. Do not persist the ambient environment merely because a child inherits it. @@ -22,26 +22,13 @@ Keep proof of ownership separate from validity, editability, and readiness. Malf For lifecycle changes, follow [ownership and completion invariants](docs/development/tool-design.md#own-the-lifecycle) and select the applicable [lifecycle regressions](docs/development/testing.md#lifecycle-regressions). Include late handshakes, cancellation during final cleanup, mixed child outcomes, and cleanup retry where those stages exist; active-execution cancellation alone does not cover finalization. -Before adding complexity for a speculative or vanishingly unlikely race or security edge case, explain the concrete failure mode, likelihood, and complexity cost to the user and get their buy-in. Do not silently expand scope for theoretical robustness. +Before adding complexity for a speculative or vanishingly unlikely race or security edge case, explain its concrete failure mode, likelihood, and complexity cost to the user and get their buy-in. Do not silently expand scope for theoretical robustness. -Check touched code for brittleness during implementation, debugging, review, -and maintenance. Look for duplicated decisions, unclear ownership, and -assumptions about state or lifecycle. Trace affected behavior through its -consumers. Fix the producing representation or ownership rule before adding -downstream repairs. When interpreting formatted input, -[normalize once at the owning boundary using a format-aware parser](docs/development/tool-design.md#interpret-boundary-facts-once). +Whenever you implement, debug, review, or maintain code, check what you touch for brittleness: duplicated decisions, unclear ownership, and assumptions about state or lifecycle. Trace affected behavior through its consumers, and fix the producing representation or ownership rule before adding downstream repairs. When interpreting formatted input, [normalize once at the owning boundary using a format-aware parser](docs/development/tool-design.md#interpret-boundary-facts-once). -Include directly related refactoring in the fix. Passing regressions alone -cannot establish that the root cause is gone. Remove superseded representations, -aliases, wrappers, and redundant tests after verifying affected consumers. -Introduce abstractions only when they remove observed complexity. Explain any -remaining cleanup and why it remains. +Include directly related refactoring in the fix; passing regressions alone cannot establish that the root cause is gone. After verifying affected consumers, remove superseded representations, aliases, wrappers, and redundant tests. Introduce abstractions only when they remove observed complexity. Explain any remaining cleanup and why it remains. -Check sibling paths for the same failure, verify suspected matches with working -controls, and group findings by root cause. - -Before resolving a review thread, explain the root cause, structural fix, -validation, and any remaining cleanup. +Check sibling paths for the same failure, verify suspected matches with working controls, and group findings by root cause. Before resolving a review thread, explain the root cause, structural fix, validation, and any remaining cleanup. Parse unknown boundary values and model expected failures with the tagged error algebra and `Result`. Preserve partial facts and meaningful failure reasons. Keep identity and lookup values separate from display formatting; preserve source values and explicit unknowns when normalization loses information. Absolute paths, file URLs, and HTTP paths have different semantics. @@ -49,41 +36,21 @@ Validate advertised JSON Schemas after SDK conversion against their declared dia ## Performance -Design analysis workflows and agent interfaces for efficiency from the first -implementation. Correctness, useful answers, Evidence provenance, caller choices, -compatibility and safe resource bounds remain required. +Design analysis workflows and agent interfaces for efficiency from the first implementation. Correctness, useful answers, Evidence provenance, caller choices, compatibility and safe resource bounds remain required. Optimize in this order: -1. Agent tokens and context. Return the smallest sufficient answer with - necessary provenance, coverage and limitations. Use task selection, - summaries, paging and retained Evidence where supported; honor requested - detail and keep complete Evidence accessible. Count the whole task, - including schemas, extra calls and retries. -2. Analysis time. Reuse validated results and shared work. Cache keys must - cover result-affecting inputs; define invalidation and lifetime. Validate - freshness before reporting cached live state as current. -3. CPU and memory. Avoid unnecessary work and copies; bound concurrency, - retained state and serialization growth. +1. Agent tokens and context. Return the smallest sufficient answer with necessary provenance, coverage and limitations. Use task selection, summaries, paging and retained Evidence where supported; honor requested detail and keep complete Evidence accessible. Count the whole task, including schemas, extra calls and retries. +2. Analysis time. Reuse validated results and shared work. Cache keys must cover result-affecting inputs; define invalidation and lifetime. Validate freshness before reporting cached live state as current. +3. CPU and memory. Avoid unnecessary work and copies; bound concurrency, retained state and serialization growth. -Reserve performance measurements for changes that target performance or have a -concrete regression concern. Routine cleanup uses correctness checks; changes -to helper calls, imports, or representations alone do not require synthetic -benchmarks. When measurement is warranted, measure representative completed -tasks and compare equivalent workflows before and after where available. Report -token usage, elapsed time, CPU time and peak process-family memory. Separate cold -and warm runs, label estimates, and state unmeasured costs. Fewer bytes alone -do not establish fewer tokens or faster analysis. +Measure performance only for changes that target it or have a concrete regression concern. Routine cleanup, including changes to helper calls, imports, or representations alone, uses correctness checks, not synthetic benchmarks. When measurement is warranted, measure representative completed tasks and compare equivalent workflows before and after where available. Report token usage, elapsed time, CPU time and peak process-family memory. Separate cold and warm runs, label estimates, and state unmeasured costs. Fewer bytes alone do not establish fewer tokens or faster analysis. ## Development -Treat code as the source of truth for implemented behavior and architecture. -Keep specs, implementation plans, task lists, ADRs, and architecture diagrams -in issue or pull request discussions or in local drafts outside Git. -Use the [documentation directory](docs/README.md) and -[authoring guide](docs/development/documentation.md) for guides and references. +Treat code as the source of truth for implemented behavior and architecture. Keep specs, implementation plans, task lists, ADRs, and architecture diagrams in issue or pull request discussions or in local drafts outside Git. Use the [documentation directory](docs/README.md) and [authoring guide](docs/development/documentation.md) for guides and references. -Use [.nvmrc](.nvmrc) and `package.json#packageManager` for the pinned toolchain. Cursor Cloud may place older Node.js first on `PATH`; environment setup installs the pinned toolchain under `/usr/local/bin`. Prefix `PATH="/usr/local/bin:$PATH"` before `node` and `npm`. +Use the toolchain pinned in [.nvmrc](.nvmrc) and `package.json#packageManager`. Cursor Cloud may place an older Node.js first on `PATH`; its environment setup installs the pinned toolchain under `/usr/local/bin`, so prefix `PATH="/usr/local/bin:$PATH"` before `node` and `npm`. - `npm ci`: install locked dependencies. - `npm run build:cached`: build the runtime and packaged skill. @@ -92,10 +59,7 @@ Use [.nvmrc](.nvmrc) and `package.json#packageManager` for the pinned toolchain. - `npm run check:fast`: cached typecheck and lint, plus architecture guards. - `npm run docs:check`: validate generated documentation. -Use relevant checks for the change. The complete local gate, `npm run check:pr`, is optional for broad changes or CI diagnosis. See [CONTRIBUTING.md](CONTRIBUTING.md) for development, generated-file ownership, and release conventions. - -When changing installers or setup recovery, follow -[Checking installers and publisher downloads](docs/development/testing.md#checking-installers-and-publisher-downloads). +Run the checks relevant to the change; the complete local gate, `npm run check:pr`, is optional for broad changes or CI diagnosis. [CONTRIBUTING.md](CONTRIBUTING.md) covers development, generated-file ownership, and release conventions. When changing installers or setup recovery, follow [Checking installers and publisher downloads](docs/development/testing.md#checking-installers-and-publisher-downloads). Coordinate expensive checks across agents. If a test unexpectedly consumes heavy CPU, stop its owned process family and profile a bounded representative case before retrying. Inspect production work, fixture generation, subprocesses, and repeated setup; preserve regression coverage when optimizing. Follow the [test resource guidance](docs/development/testing.md#developer-commands). @@ -105,42 +69,17 @@ Coordinate expensive checks across agents. If a test unexpectedly consumes heavy For tool design, follow [docs/development/tool-design.md](docs/development/tool-design.md): start from the analyst question, reuse existing contracts, preserve caller choices, and return useful evidence inline. Admission limits, which refuse or stop work, must follow real format, protocol, authority, or resource constraints; delivery budgets size inline output for the consumer, never refuse, and keep the complete result retrievable. Account for representation expansion before allocation; derive completeness from examined coverage. -Choose the scope of a new limit from [analysis settings, limits, and recovery](docs/reference/limits-and-recovery.md). -A registered runtime setting may have an optional launch seed. Per-call and -launch-only controls have their own contracts. Report the effective limit and -recovery for the control that stopped the work, and document the setting ID -and `update_analysis_settings` for changes that apply at runtime. +Choose the scope of a new limit from [analysis settings, limits, and recovery](docs/reference/limits-and-recovery.md). A registered runtime setting may have an optional launch seed; per-call and launch-only controls have their own contracts. Report the effective limit and recovery for the control that stopped the work. For changes that apply at runtime, document the setting ID and `update_analysis_settings`. -For user- or agent-facing tool problems, prioritize fixing the owning behavior, -contract, and actionable result or recovery at the point of use. Document the -result in product docs when explanation is needed. Add skill guidance only for -workflow judgment or context that the tool cannot reasonably convey; do not use -a skill as the primary repair for a discoverability or contract defect. +For user- or agent-facing tool problems, fix the owning behavior, contract, and actionable result or recovery at the point of use first. Document the result in product docs when explanation is needed. Add skill guidance only for workflow judgment or context that the tool cannot reasonably convey; a skill is not the primary repair for a discoverability or contract defect. For test changes or provider claims, use [docs/development/testing.md](docs/development/testing.md). Select applicable [boundary regressions](docs/development/testing.md#boundary-regressions) for parser, inventory, snapshot, and projection fixes. Prefer real public CLI/MCP workflows, then production-boundary integration, then producer goldens. Keep module tests for distinct semantics stronger workflows cannot reliably reproduce. Preserve malformed-input, cancellation, cleanup, permission, capacity, and target-identity coverage when pruning. Report unverified coverage explicitly; simulated providers do not establish real-provider behavior. -Use structured facts to test behavior and assert wording when wording is part -of the contract. Follow [test design and pruning](docs/development/testing.md#test-design-and-pruning) -and use the [supervised command owner](docs/development/testing.md#verifier-scripts) -for commands launched by a verifier. +Test behavior through structured facts, and assert wording when it is part of the contract. Follow [test design and pruning](docs/development/testing.md#test-design-and-pruning) and use the [supervised command owner](docs/development/testing.md#verifier-scripts) for commands launched by a verifier. -Use Conventional Commit subjects and PR titles as specified under [pull request ownership and readiness](CONTRIBUTING.md#pull-request-ownership-and-readiness). Mark breaking changes with `!` or a `BREAKING CHANGE:` footer. Describe behavior changes, relevant validation, and real-provider verification scope. +## Issues and Pull Requests -## Issue Reports - -Follow [issue reporting guidance](CONTRIBUTING.md#reporting-issues) and the matching -issue form. Keep reports concise and cite the smallest useful evidence. -Distinguish observed results, source-derived reasoning, hypotheses, and proposed -checks. Never claim runtime reproduction or measurements you did not perform. -Use `NOT_ENOUGH_INFO` with an explanation for missing narrative answers or evidence. -Incomplete reports, source-only findings, and early feature or design ideas are -welcome when their limitations are explicit; a completed diagnosis or fix is not -required to open an issue. - -## Pull Request Readiness - -Follow [human ownership and readiness](CONTRIBUTING.md#pull-request-ownership-and-readiness) -when preparing a PR. Leave human readiness declarations to the human owner. +Follow the [issue reporting guidance](CONTRIBUTING.md#reporting-issues) and the matching issue form, and the [pull request ownership and readiness rules](CONTRIBUTING.md#pull-request-ownership-and-readiness). Use Conventional Commit subjects and PR titles as specified there, and mark breaking changes with `!` or a `BREAKING CHANGE:` footer. Describe behavior changes, relevant validation, and real-provider verification scope. Leave human readiness declarations to the human owner. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9824faf4e2..9ab4601832 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,14 +69,13 @@ and suspected causes explicit. Incomplete reports and intermittent failures are welcome. If a narrative answer or supporting evidence is unavailable, write `NOT_ENOUGH_INFO` and explain the gap. Clearly label source-only findings and proposed checks; do not claim runtime -reproduction or results you did not observe. A root-cause analysis or fix is not +reproduction, measurements, or results you did not observe. A root-cause analysis or fix is not required to report a problem. Documentation reports should identify the relevant passage or missing guidance and explain the correction or confusion. Feature and design proposals can start with a problem and desired outcome. Examples, prior art, and measurements help when available; ideas without them are welcome. Maintainers can investigate reports and help resolve open questions. -Human ownership and readiness declarations apply to PRs as described below. ## Pull request ownership and readiness @@ -108,7 +107,7 @@ outcome, approach, and useful evidence; link long logs or put them in optional details. Address actionable automated review findings and explain disagreements. Human ownership and review remain required when CI or an automated reviewer reports success. Readiness requests maintainer review; it does not grant scope -approval or permission to merge. +approval, permission to merge, or a review date. Pull request titles must match the Conventional Commits check in [`.github/workflows/pr-title.yml`](.github/workflows/pr-title.yml): @@ -117,11 +116,8 @@ Pull request titles must match the Conventional Commits check in /^(?:feat|fix|docs|refactor|perf|test|build|ci|chore|revert)(?:\([a-z0-9._/-]+\))?!?: .+/u ``` -The type is `feat`, `fix`, `docs`, `refactor`, `perf`, `test`, `build`, `ci`, -`chore`, or `revert`. An optional scope, in parentheses, uses only lowercase -`[a-z0-9._/-]`. An optional `!` may precede the colon. The title then has `: ` -and a non-empty outcome, for example `feat: add historical source import`. -The type `style` fails, and an uppercase scope fails. +For example, `feat: add historical source import` passes; the type `style` and +an uppercase scope fail. Draft status is optional. Draft PRs may request early feedback with open questions and incomplete checks. Agents preserve the current draft status unless asked to @@ -130,8 +126,7 @@ to become a draft. Leave the readiness declaration unchecked until the human owner has completed it. The declaration records initial readiness; later pushes do not invalidate -it or require another human sign-off. Keep the PR description and affected -validation current as work changes. AI agents must leave human declarations to +it or require another human sign-off. AI agents must leave human declarations to the human owner and must not attest to a human review on their behalf. Maintainers review the **Author readiness** declaration in the PR body. PRs @@ -147,11 +142,10 @@ overlap is known. Prefer one clear pointer over repeated status updates. If an overlapping change merges while a PR awaits review, link that commit on the open PR and state what remains useful. Rebase or otherwise align with the current base when the remaining work is still wanted, narrow the PR to the -uncovered portion, or close it when the change is fully superseded. Keep the -description and validation current after that update. Maintainers may also note -the expected disposition (rebase, narrow, or close) when they land or recognize -an overlapping fix. Readiness still does not grant merge permission or a review -date. +uncovered portion, or close it when the change is fully superseded, then update +the description and validation. Maintainers may also note the expected +disposition (rebase, narrow, or close) when they land or recognize an +overlapping fix. Maintainers may return a PR to the author or close it when the problem is unsupported, validation is missing, or the owner cannot explain the change. @@ -289,8 +283,8 @@ Commits that only move files or rewrite import paths are listed in attributes lines to the change that wrote them. Move files with `git mv` and keep such a commit free of other edits. -Repository invariants live in [AGENTS.md](AGENTS.md). Keep provider-specific -protocols in adapters and shared CLI/MCP workflows in the application layer. +Repository invariants, including layering, live in +[AGENTS.md](AGENTS.md#architecture-and-cleanup). ### Windows source checkouts @@ -328,19 +322,15 @@ then rerun the command. ## Documentation website -Use the [documentation directory](docs/README.md) and -[authoring guide](docs/development/documentation.md) for document ownership. - +The [documentation directory](docs/README.md) and +[authoring guide](docs/development/documentation.md) own document placement, +navigation, public links and +[documentation checks](docs/development/documentation.md#generated-ownership-and-checks). The VitePress site uses the Markdown files in `docs/`. Run `npm run docs:dev` for live editing and `npm run docs:preview` to serve an existing build at -`/rea/`. Follow the [documentation checks](docs/development/documentation.md#generated-ownership-and-checks) -to build and verify the rendered routes and anchors. - -The [authoring guide](docs/development/documentation.md#links-and-public-routes) -explains where to edit navigation and how to preserve public links. The -`Documentation` CI job runs the documentation and rendered-route checks. -The manual VitePress workflow in `.github/workflows/pages.yml` builds these -guides for verification. +`/rea/`. The `Documentation` CI job runs the documentation and rendered-route +checks; the manual VitePress workflow in `.github/workflows/pages.yml` builds +these guides for verification. The product website in `website/public/` has a separate [publishing workflow](website/README.md#synchronized-production-publishing) for @@ -386,7 +376,8 @@ Before requesting review, run relevant tests and `npm run check`; add `npm run docs:check` when contracts or generated metadata change. Record the checks and unavailable coverage. CI owns the full deterministic suite and coverage. `npm run check:pr` is an optional broad local suite for large changes or -CI diagnosis. Packaging/setup/distribution changes additionally require +CI diagnosis; it reuses build and static-check outputs while running the test +suite fresh, including the fast Python producer checks. Packaging/setup/distribution changes additionally require `npm run verify:package` and `npm pack --dry-run`; provider changes require the matching real-provider lane. State which host/provider workflows ran. @@ -394,9 +385,8 @@ For CI/test correctness, drift, or performance investigations, use the [`rea-ci-tests-audit` contributor skill](.agents/skills/rea-ci-tests-audit/SKILL.md). It guides reproduction and comparable measurements before changing checks. -`check:pr` reuses build and static-check outputs while executing the test suite -fresh, including the fast Python producer checks. `docs:check` also runs the -onboarding example consistency suite for README-only changes. +`docs:check` also runs the onboarding example consistency suite for README-only +changes. Pre-commit formats and lints staged files; pre-push runs `check:fast`. @@ -464,19 +454,6 @@ Generated fixtures and manifests remain ignored. ## Maintainer release checklist -Use the [release guide](docs/development/releasing.md). Main pushes automatically refresh a -Release Please PR with the next version and changelog. Review its migration -notes, wait for the current CI checks to pass, and merge it into main to publish. - -The Release workflow validates and tags that merge; both publishers build its -exact SHA. Ordinary main pushes cannot publish packages. An optional manual -`release/VERSION` checkpoint retains explicit preparation and publication. - -For grouped release notes with verified contributor thanks, use the repository's -`rea-changelog-update` skill in `.agents/skills/rea-changelog-update/`. Its inventory, -credit checks, and finalization process are described in the release guide. - -Keep new implementation commits on main for the next release. The workflow -owns packaged-artifact verification, npm publication, the published CLI/MCP -canary, and MCP Registry publication. Sync manual checkpoint metadata back to -main after publication; see the guide for recovery and verification. +The [release guide](docs/development/releasing.md) owns the Release Please PR, +publication, the optional manual `release/VERSION` checkpoint, recovery and +[contributor-aware release notes](docs/development/releasing.md#contributor-aware-release-notes). diff --git a/docs/development/client-verification.md b/docs/development/client-verification.md index 378c2fead0..754c5959c7 100644 --- a/docs/development/client-verification.md +++ b/docs/development/client-verification.md @@ -45,12 +45,11 @@ and [renderer usage notes](https://github.com/earendil-works/pi/blob/b45e0ebcc5a ## Cline -The original contributor reported a run on 2026-11-11 on Linux (Fedora 45), -using Cline CLI 3.0.74 and the integration based on REA `main` at `9924bf344`. -That run checked client config listing and a direct registered-server MCP -handshake that listed the complete catalog of that build. It predates the -verifier lifecycle changes below and does not establish their real-client -behavior. +The last real-client run, on 2026-11-11 on Linux (Fedora 45) with Cline CLI +3.0.74 and REA `main` at `9924bf344`, checked client config listing and a direct +registered-server MCP handshake that listed the complete catalog of that build. +It predates the current verifier lifecycle and does not establish its +real-client behavior. `npm run verify:cline-client` creates its sandbox home before launching commands and removes inherited `CLINE_MCP_SETTINGS_PATH`, `CLINE_DATA_DIR` and `CLINE_DIR`. @@ -63,10 +62,9 @@ completes SDK initialization and tool discovery through REA's owned stdio transport. Stdin stays open until discovery finishes. Command and transport cleanup completes before the verifier records lineage or reports success. -The updated orchestration has recording-port coverage for delayed discovery, -failed server identification and failed cleanup. These tests use the installed -SDK and verifier lifecycle owner, but do not execute Cline or a real REA server. -The updated real-client lane has not been rerun during this reconciliation. +The orchestration has recording-port coverage for delayed discovery, failed +server identification and failed cleanup. These tests use the installed SDK and +verifier lifecycle owner, but do not execute Cline or a real REA server. Not covered by the lane: a model-driven tool call inside Cline. Cline's provider configuration (`providers.json`) is versioned and auth-shaped, and the CLI ignores @@ -208,28 +206,16 @@ ID). Every actual HTTP request's model is checked and recorded separately. Both `HOME` and `USERPROFILE` point to the disposable account; native `skill add` still selects the installed skill directory explicitly. -The same native client passed chat and analysis under REA's former full input -profile with the actual wire model `gpt-4.1` under a distinct BYOK model ID: - -```bash -REA_VERIFY_COPILOT_MODEL=rea-gpt-4.1 REA_VERIFY_COPILOT_WIRE_MODEL=gpt-4.1 npm run verify:copilot-client -- chat -REA_VERIFY_COPILOT_MODEL=rea-gpt-4.1 REA_VERIFY_COPILOT_WIRE_MODEL=gpt-4.1 npm run verify:copilot-client -- call -``` - -Those runs used the fixture's requested one-million-token BYOK prompt setting; -effective capacity and live API acceptance remain unknown. With the built-in -`gpt-4.1` model ID, the verified client blocked the former full input-schema -profile before HTTP with `compaction_static_context_blocked`. That profile was -removed, so the verifier now compares the input schemas forwarded by Copilot -with REA's compact advertisement: +With the built-in `gpt-4.1` model ID, the verifier compares the input schemas +forwarded by Copilot with REA's compact advertisement: ```bash REA_VERIFY_COPILOT_MODEL=gpt-4.1 npm run verify:copilot-client -- chat REA_VERIFY_COPILOT_MODEL=gpt-4.1 npm run verify:copilot-client -- call ``` -The recorded client results above remain scoped to their executed revisions; -this verifier change is not a new client run. Compact native workflows passed +Recorded client results remain scoped to their executed revisions. Compact +native workflows passed with the complete tool inventory. Compact advertisements can reduce nested validation structure; the server still validates complete canonical inputs. Live model APIs, native Windows and default OS-home skill discovery remain diff --git a/docs/development/documentation.md b/docs/development/documentation.md index da689f78ab..4d794a0a11 100644 --- a/docs/development/documentation.md +++ b/docs/development/documentation.md @@ -58,6 +58,11 @@ or its inputs and regenerate. Do not write the number of tools in living prose; link the generated catalog instead. `docs:check` refuses a count of ten or more tools outside dated records (`docs/releases/` and `docs/verification/`). +Keep a verification record only while a document, test or script cites it; +otherwise put its measurements in the PR or issue, as the +[repository guidance](https://github.com/morluto/rea/blob/main/AGENTS.md#development) +directs for plans and design records. Test data that a test reads belongs in +`tests/fixtures/`, not `docs/verification/`. Run `npm run docs:check` for documentation facts and generated consistency, and `npm run verify:docs:routes` to build the complete production site and check local diff --git a/docs/development/reconstruction-readiness.md b/docs/development/reconstruction-readiness.md index 70842ae71a..dc724fe35b 100644 --- a/docs/development/reconstruction-readiness.md +++ b/docs/development/reconstruction-readiness.md @@ -32,8 +32,7 @@ full report as the `reconstruction-readiness` artifact. ## Report scope and ownership -The verifier runs as `npm run verify:readiness`; it is not exposed as a public -CLI command or MCP tool. Its report separates two kinds of verification: +The verifier is not exposed as a public CLI command or MCP tool. Its report separates two kinds of verification: - `observed_journeys` retains the actual static-analysis Evidence and the observed CLI/MCP identity checks, with their coverage limits. @@ -45,10 +44,9 @@ The verifier's overall success means its listed checks passed. It is not an end-to-end reconstruction-readiness verdict. Actual analysis Evidence is not grafted into the synthetic report or used to close its checks. -The retained artifact now uses `schema: "ReconstructionReadinessVerificationReport"` -and `schema_version: 1`. The previous unversioned artifact was the nine-stage -evaluator report itself. Consumers should read the two explicit sections; the -synthetic nine-stage report now lives at `evaluator_conformance.baseline_report`. +The retained artifact uses `schema: "ReconstructionReadinessVerificationReport"` +and `schema_version: 1`. Consumers read the two explicit sections; the +synthetic nine-stage report lives at `evaluator_conformance.baseline_report`. Observed CLI and MCP Evidence are retained in separate bundles under `observed_journeys.evidence_bundles`, preserving each surface's records. diff --git a/docs/development/releasing.md b/docs/development/releasing.md index e5e5e81734..80d58363f1 100644 --- a/docs/development/releasing.md +++ b/docs/development/releasing.md @@ -40,9 +40,7 @@ Before publishing, npm lookup failures and malformed metadata stop the job. An existing version must match the qualified tarball's SHA-512 and intended `latest`/`next` dist-tag before it can be reused. Publication never overwrites an existing version or silently changes a dist-tag. After publication, confirmed -registry absence is polled every 30 seconds for a 75-minute retry window. This -covers the roughly 55 minutes between npm accepting 6.10.1 and the registry -recording it. Lookup errors and content or tag mismatches fail immediately. If +registry absence is polled every 30 seconds for a 75-minute retry window. Lookup errors and content or tag mismatches fail immediately. If visibility takes longer, rerun the failed jobs in the original workflow once the package appears. A separate post-publication job with read-only repository/actions permissions verifies registry bytes and tags, then installs @@ -68,11 +66,9 @@ the original run after a partial publication. ## Check the packed catalog with client engines -rea-agents 6.9.0 advertised a pattern that RE2 and Rust's `regex` cannot -compile, so clients rejected the whole tools list -([#10830](https://github.com/morluto/rea/issues/10830)). Release qualification -runs `ci.yml` on the release revision, and its build job checks the advertised -catalog with every client engine and, in full qualification, Python +A client that cannot compile one advertised pattern can reject the whole tools +list. Release qualification runs `ci.yml` on the release revision, and its build +job checks the advertised catalog with every client engine and, in full qualification, Python `jsonschema`; a refusal fails qualification, so publication does not start. To check the archive itself, for example when auditing a release or @@ -288,15 +284,12 @@ registry metadata or changelog disagrees with that version before creating a tag ### Compatibility and version selection Before publishing a candidate, review its changelog's breaking changes and the -migration notes for the release being prepared. The -[6.1 to 6.2 migration guide](../migrations/migration-6.2.md) records that release's changes; -it is a historical reference, not the compatibility checklist for later releases. +migration notes for the release being prepared. REA uses Release Please's `always-bump-minor` strategy: every release increments minor and resets patch, including releases with breaking changes. For example, the next release after 6.0.0 is 6.1.0. Version numbers use the SemVer format, -but a minor increment does not promise backward compatibility. Review the -changelog's breaking-change section and migration notes before upgrading. +but a minor increment does not promise backward compatibility. The supported public surface includes documented CLI commands/options, MCP tool names and input/result contracts, saved evidence formats and supported runtime