* feat(native): decode Android .note.android.ident ELF notes Decode Android NDK NT_ANDROID_TYPE_IDENT (.note.android.ident, owner Android, type 1) notes in inspect_elf_notes across legacy 4-byte and modern >=132-byte descriptors with bounded TextBudget accounting. * fix(native): isolate Android note scan budget test, scope contract import, and add feature spec * test(native): use domain tool contract in elfNotesMcp boundary test
1.9 KiB
Implementation plan
Boundary and contract
Extend ELF_NOTE_TYPE_NAMES, androidNoteTypeName, and elfNotesSchema in
src/domain/native/elfNotes.ts with "android_ident" and nullable
android: { android_api, ndk_version, ndk_build_number } on each note entry.
Implement scanAndroidIdentSlot and decodeAndroid in
src/native/elf/ElfNoteParser.ts, invoked from toEntry alongside decodeGnu
and decodeCore. Cache the 128-byte fixed-slot scan per descriptor range under
android:${byteOffset}:${length} in TextBudget.scans, charge scanned once
per distinct range, and charge retained ndk_version and ndk_build_number
lengths to TextBudget.used. Update the inspect_elf_notes description in
src/contracts/native/binaryDiagnosticsToolContracts.ts and the owning guide
ELF note tables.
Incremental work and validation
- Extend
src/domain/native/elfNotes.tsand add unit tests insrc/domain/native/elfNotes.test.ts. - Add
androidIdentNotefixture support insrc/native/elf/ElfNotes.fixture.tsand implementdecodeAndroidinsrc/native/elf/ElfNoteParser.tswith endianness, malformed-slot degradation, andTextBudgetaccounting tests insrc/native/elf/ElfNoteParser.test.ts. - Add MCP boundary tests (
tests/boundary/mcp/elfNotesMcp.test.ts) and CLI/stdio-MCP parity acceptance tests (tests/acceptance/elfNotesAndroid.test.ts) importingBINARY_DIAGNOSTICS_TOOL_CONTRACTS. - Update ELF note tables and the feature specification index; pass formatting, static, typed-lint, test, and documentation gates.
Effects and compatibility
inspect_elf_notes / inspect-elf-notes entries gain additive "android_ident"
and nullable android fields while preserving existing gnu, core, and
raw descriptor provenance. No external tools, network calls, or target
execution are introduced.