feat(artifacts): inventory and extract Linux romfs filesystem images offline #15138
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #15138"
general
weight: 0.35
mvanhorn
Summary
Linux embedded firmware images frequently ship read-only root filesystems in the Linux
romfsformat (-rom1fs-superblock with 16-byte aligned file headers, 32-bit big-endian checksum, directories, regular files, hard links, symlinks, and device nodes). Today REA does not recognizeromfsimages, soinspect-artifactcannot enumerate their filesystem entries andextract-artifactcannot pull regular files out for downstream inspection without mounting the image.This adds an offline
linux-romfsartifact format.inspect-artifactandextract-artifactrecognize-rom1fs-images by superblock structure and checksum verification, list directories, regular files, symlinks (preservinglink_target), hard links, and special nodes with exact byte offsets and sizes, and extract regular files safely inside the output directory while omitting special nodes and symlink traversal. No issue exists for this; it is a read-only offline format addition within the supported contribution scope.Problem and expected behavior
Use case: given an embedded
rootfs.romfsimage, list its volume name, superblock checksum status, directory tree, symlinks, and file sizes offline, and extract regular files (such as/etc/init.d/rcSor/bin/app) into a workspace directory with containment checks and bounded read ceilings.Change and scope
src/domain/firmware/romfs.ts(withromfs.fixture.tsandromfs.test.ts) to parse the-rom1fs-superblock, verify the 512-byte big-endian word checksum, walk 16-byte-aligned entry headers with cycle detection and bounded entry/depth/name ceilings, and classify regular files, directories, symlinks, hard links, and special device/socket/FIFO nodes.src/artifacts/RomfsArtifactReader.ts(with unit and boundary tests) and registeredlinux-romfsacrossartifactFormats.ts,artifactFormatRecognition.ts,artifactFormatMetadata.ts,artifactGraph.ts,targetFormats.ts,ArtifactReader.ts,PositionalArtifactReader.ts,artifactInventoryView.ts,firmwareMetadata.ts, andscripts/verify/fixed-ceiling-registry.json.docs/guides/firmware/romfs-images.md, VitePress nav, CLI/supported-targets/limits docs, and authored skill references under.agents/skills/reverse-engineer-anything/and.cursor-plugin/skills/reverse-engineer-anything/.Follow the contribution scope. Not applicable for target execution/injection scope decisions: this is a strictly read-only offline file parser.
Contract and boundary impact
src/domain/firmware/romfs.tsowns allromfsbyte parsing, checksum verification, cycle detection, and entry normalization;RomfsArtifactReaderand inventory views consume the parsed domain result without re-parsing bytes.inspect-artifactandextract-artifactgainlinux-romfsrecognition and inventory/extraction support with existing output schemas preserved.docs/public/product-catalog.json), package, or installation impact: authored skill text updated in.agents/skills/reverse-engineer-anything/and.cursor-plugin/skills/reverse-engineer-anything/; no generated build outputs committed.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/firmware/romfs.test.ts,src/artifacts/RomfsArtifactReader.test.ts,src/artifacts/RomfsArtifactReader.boundaries.test.ts,src/domain/artifactFormatRecognition.test.ts,src/application/binary/TargetFormatVocabularies.test.ts,tests/boundary/providers/native/artifactProvider.standaloneFormats.test.ts(6 files, 159 tests passed).inspect-artifacthad nolinux-romfsrecognizer and fell back to raw/unrecognized bytes. After this change, synthetic fixture tests cover valid checksum, corrupt checksum, cyclic next-header offsets, out-of-bounds payloads, symlinks, hard links, special nodes, and extraction path containment.node scripts/rea.mjs inspect-artifactandextract-artifactagainst a synthetic 640-byterootfs.romfsimage; observed superblock checksum verified (sum 0), symlinks retained inlink_target, special nodes omitted on extraction, and regular files extracted withcontainment_verified: true.Boundary and lifecycle regressions:
RomfsArtifactReader.boundaries.test.tsandartifactProvider.standaloneFormats.test.tsverify bounded reads, cycle termination, truncation handling, and extraction containment cleanup.For evidence-bearing changes:
Validation performed
npm run test:focused -- src/domain/firmware/romfs.test.ts src/artifacts/RomfsArtifactReader.test.ts src/artifacts/RomfsArtifactReader.boundaries.test.ts src/domain/artifactFormatRecognition.test.ts src/application/binary/TargetFormatVocabularies.test.ts tests/boundary/providers/native/artifactProvider.standaloneFormats.test.ts— 6 files, 159 tests passed.npm run verify:test-discovery— passed (4083 test/spec files).npm run check— passed (typecheck, lint, format:check, knip, metadata:check, verify:architecture-guards across 3332 files, knip:production, lint:typed).npm run docs:check— passed (docs:check:built+ 8/8readmeConsistencytests).node scripts/rea.mjs inspect-artifact/extract-artifacton syntheticrootfs.romfs— verified inventory, checksum status, omission of special nodes, and contained extraction.Compatibility, safety, and release
linux-romfs).fixed-ceiling-registry.json, and extraction containment verification. Special device nodes and symlinks are never materialized as host device files or escaping links.AI was used for assistance.
Author readiness
Human owner: @mvanhorn
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.Demo
!demo
<video src="https://mvanhorn.github.io/pr-demo-assets/rea/2026-11-29-100-feat-linux-romfs-inventory/out.mp4" controls width="720"></video>