Files
Kaoru0822andClaude Opus 5.5 c02945bc44 feat(native): decode Swift nominal type declarations from __swift5_types (#6257)
* feat(native): decode Swift nominal type declarations from __swift5_types

Fill swift_decls from the nominal type context descriptors that survive
stripping: kind (class, struct, enum, actor), own and qualified name,
module, generic flag, anonymous-context flag, metadata accessor and
descriptor location, with evidence citing the type record. Unresolved
parent contexts keep qualified_name null and the entry partial.

One shared reader walks each context once; class vtable recovery now
consumes its descriptors instead of re-reading the records, so a type
record that cannot be read keeps both facets partial. Remove the
never-populated swift_decls fields that descriptors do not carry.

Fixes #5341

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(native): bound Swift context walks and decode vtables in record order

Address review of the nominal-type reader:

- Cache intrinsic context depth (distance to the module) so a cached
  parent cannot bypass the 32-context bound, and never cache a stop that
  depends on where the walk began. Bound qualified names to 4096
  characters so nesting cannot multiply name storage.
- Visit each descriptor as soon as its kind and name are read, so a
  class vtable spends the record budget in record order instead of after
  every later declaration.
- Report an accessor outside executable mapped code as null and keep the
  declaration partial.
- Forward a name failure to vtable coverage only when the record is a
  class or its kind is unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 00:19:15 -07:00
..

Source-built conformance fixtures

These sources are deliberately small semantic oracles for REA providers. Run npm run verify:fixtures on macOS or Linux to compile them into the ignored build/conformance/ directory, emit a hash-and-toolchain manifest, and verify their platform-native symbols and strings with local command-line tools. The portable C, version, and large-inventory fixtures build as Mach-O on macOS and ELF on Linux; Objective-C, Swift, and N-API-like fixtures remain macOS-only.

Only source files are versioned. Generated binaries, generated large-fixture source, debug information, and manifests must remain under build/.

ghidra/inventory.c is also compiled into temporary Linux ELF debug and stripped variants by npm run verify:ghidra. It fixes local functions, external puts linkage, defined strings, and writable/executable memory needed to prove the read-only Ghidra inventory contracts without committing a binary.

scripts/create-ghidra-windows-fixture.mjs separately emits a deterministic, ignored native x86-64 PE application for the controlled Windows Ghidra P0 lane. The generator and fixed SHA-256 are versioned; the .exe is never committed or executed. npm run verify:ghidra:windows uses it to verify the admitted read-only operation inventory, digest linkage, transport, and cleanup on the self-hosted real-Ghidra runner.

The C fixture fixes a known call chain and strings. The version pair fixes an added symbol, changed string, and changed call relationship. The generated large fixture contains 1,205 uniquely named functions and strings to verify that providers return complete inventories. Objective-C, Swift, and N-API-like fixtures provide metadata-oriented inputs without package or network dependencies.

readiness/ adds source-only generated JavaScript CLI and Electron fixtures for the repository's reconstruction-readiness verifier. npm run verify:readiness combines them with the compiled native fixtures, exercises CLI and MCP parity for real analysis operations, and checks the internal machine-readable report documented in docs/reconstruction-readiness.md.