Repository navigation
feat(artifacts)!: inventory and extract ISO 9660 disc images offline - #13290
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The changes reach ISO artifact inspection, extraction, and binary target routing. The code has no newly confirmed blocking defect, but the required issue discussion must be linked before merging. Findings
Fix with agent prompt### Issue 1
src/domain/iso9660/iso9660Structures.ts:undefined-19
This PR adds ISO 9660 support, but its description says no issue exists for the addition. The repository requires an issue explaining the problem and proposed solution before submitting changes. Being within the supported contribution scope does not waive that requirement. Open or discuss the issue and link it here before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds offline ISO 9660 inspection and extraction through the existing CLI and MCP workflows.
Review used source checks; no tests were run. Whether another PR supersedes this one could not be checked because GitHub access was not authenticated. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Local image or archive member] --> B[Recognize ISO descriptor signature]
B --> C[Read bounded volume descriptors]
C --> D{Eligible Joliet tree?}
D -->|Yes| E[Walk Joliet tree]
D -->|No| F[Walk primary tree]
E --> G[List entries and coverage limits]
F --> G
G --> H{Readable byte range?}
H -->|Yes| I[Hash and classify content]
H -->|No| J[List with unavailable hash]
I --> K[Extract selected files through shared output checks]
Reviews (9) · Last reviewed commit: "feat(artifacts)!: inventory and extract ..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8174ea259b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@mvanhorn thanks for the PR — there is 1 open review thread here:
Could you address or reply to this? Once it's resolved and CI is green we can take another look. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
2 similar comments
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Rebase failed
|
Thanks for working through these. All review threads are resolved, including the zero-length extent one, and CI is green on the latest merge of main. Nothing else pending from me. |
Add an offline iso9660 artifact format. inspect-artifact and extract-artifact (and the MCP tools) read the volume descriptors and one directory tree, list each file and directory as an occurrence, and extract stored file bytes without mounting the image or calling a host tool. Traversal limits are exposed via artifact_limits.iso9660. BREAKING CHANGE: artifactReaderLimitsSchema now requires iso9660 (descriptor_count, directory_depth, record_count, directory_bytes, path_bytes), so saved Evidence records containing effective_limits from prior versions without iso9660 fail parseInventoryPage validation and must be re-inspected.
8418b22 to
ba75c73
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@morluto thank you for landing ISO 9660 support, so disc images can be inspected and extracted offline without mounting them first. |
| * volume descriptor parser. Both-endian fields are decoded from both halves | ||
| * and must agree. Rock Ridge (SUSP) system-use fields are not decoded. | ||
| */ | ||
| export const ISO9660_FORMAT = "iso9660"; |
There was a problem hiding this comment.
Required issue discussion is missing
This PR adds ISO 9660 support, but its description says no issue exists for the addition. The repository requires an issue explaining the problem and proposed solution before submitting changes. Being within the supported contribution scope does not waive that requirement. Open or discuss the issue and link it here before merging.
Rule Used: Before submitting changes, open or discuss an issue that explains the problem and proposed solution; group related changes into a focused PR rather than submitting many separate small PRs, especially one-line changes. (source)
Learned From
morluto/rea#9396
morluto/rea#9399
morluto/rea#9392
+2 more
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/iso9660/iso9660Structures.ts
Line: 19
Comment:
**Required issue discussion is missing**
This PR adds ISO 9660 support, but its description says no issue exists for the addition. The repository requires an issue explaining the problem and proposed solution before submitting changes. Being within the supported contribution scope does not waive that requirement. Open or discuss the issue and link it here before merging.
**Rule Used:** Before submitting changes, open or discuss an issue that explains the problem and proposed solution; group related changes into a focused PR rather than submitting many separate small PRs, especially one-line changes. ([source](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fmorluto%2Frea%2Fcustom-context%3Fmemory%3D521f5678-e034-42c8-ae87-2f566638aac6))
**Learned From**
[morluto/rea#9396](https://github.com/morluto/rea/pull/9396)
[morluto/rea#9399](https://github.com/morluto/rea/pull/9399)
[morluto/rea#9392](https://github.com/morluto/rea/pull/9392)
*+2 more*
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Installer, recovery and appliance media often ship as
.isofiles, and firmware bundles sometimes nest one inside another archive. REA does not recognize ISO 9660 today, so an analyst gets an unknown blob and has to mount the image or run7z/xorrisooutside REA before inspecting what is inside, losing Evidence provenance for every file.This adds an offline
iso9660artifact format.inspect-artifactandextract-artifact(and the MCPinspect_artifact/extract_artifacttools) read the volume descriptors and one directory tree, list every file and directory as an occurrence, and extract stored file bytes without mounting the image or calling a host tool. No issue exists for this; it is a format-inspection and ordinary-extraction addition within the supported contribution scope.Problem and expected behavior
Use case: given
installer.iso, see its volume facts and file tree, find thatbin/setup.exeis a PE file, and extract it for further REA analysis.Observable outcome:
CD001descriptor at sector 16 is recognized asiso9660regardless of filename, including inside another archive and when named with a Hopper.hopsuffix (selecting the database target kind keeps the database interpretation).name_source.completeonly for a primary-only image; otherwise it isunknownwith a limitation naming each tree that was not walked, because REA does not establish that the trees list the same files.setup.exeinside the image reportspe.hash_status: "unavailable"and a limitation, not silently skipped or partially read.Change and scope
src/domain/iso9660/owns parsing:iso9660VolumeDescriptors.ts(descriptor set, both-endian fields, Joliet eligibility, El Torito record),iso9660Structures.ts(directory records, extents,./..self-checks, volume sequence numbers),iso9660Members.ts(multi-extent grouping, name normalization and safe renames),iso9660Dates.ts.src/artifacts/Iso9660ArtifactReader.tsreads through the shared positional reader.PositionalArtifactReader.tsnow rechecks image identity before refusing an entry from cached facts; Godot PCK encrypted members get the same fix and a test.artifactFormatRecognition.ts, registration inartifactFormats.ts, classification and inventory graph wiring, andBinaryTargetResolver.tscontent precedence over the.hopfilename fallback. The whole-file UEFI probe (UefiFormatProbe.ts) now defers to any format the shared recognizer table identifies, so an ISO carrying a firmware volume keeps its file tree in both inventory andopen_binary.artifact_limits.expanded_bytesbudget. The walk yields and checks cancellation every 256 records or padded sectors.docs/guides/firmware/iso9660-images.md, sidebar, CLI reference, docs index and skill references.Not included: Rock Ridge, UDF, El Torito boot catalogs and boot images, path tables, extended attribute contents, multi-volume sets, and reading separated or interleaved files.
Contract and boundary impact
src/domain/iso9660/parsers produce facts; the reader, inventory graph and resolver consume them without reparsing raw bytes.iso9660;open_binaryreportsformat: "iso9660".iso9660. A.hop-named file whose content is ISO 9660 now resolves as ISO 9660 unless the database kind is selected.iso9660andiso9660-entrymetadata shapes; children carry stored ranges and SHA-256.docs/public/product-catalog.json), package, or installation impact: none committed; authored skill references updated under.agents/skills/reverse-engineer-anything/.Expected effects:
Evidence and regression coverage
src/domain/iso9660/iso9660Structures.test.ts(descriptors, both-endian disagreement, Joliet eligibility and tree coverage, dates, multi-extent grouping, version suffixes,./..rules, unsafe names),Iso9660ArtifactReader.test.tsand.boundaries.test.ts(limits, cycles, truncation versus malformed extents, volume references, cancellation inside long chains and padding runs, changed-image identity),tests/acceptance/iso9660Cli.test.ts,tests/boundary/mcp/iso9660Mcp.test.ts(including an ISO namedinstaller.hop), plus format recognition, target diagnostics, inventory graph and Godot PCK tests. Fixtures are built iniso9660.fixture.ts.unsupported_target; the new boundary tests fail there.rea inspect-artifact installer.iso --detail summary --evidence_output installer.evidence.json --json, excerpt ofroot_format_metadataon a generated Joliet image with an El Torito record):{ "kind": "iso9660", "system_identifier": "REA DEMO", "volume_identifier": "INSTALLER", "volume_space_size": 29, "logical_block_size": 2048, "root_directory_extent": 23, "creation_date": "2024-01-02T03:04:05.00+01:00", "volume_descriptor_count": 4, "el_torito_boot_record": true, "boot_catalog_sector": 28, "joliet_level": 3, "name_source": "joliet", "directory_count": 2, "file_count": 3 }with limitations including "The primary directory tree (root extent at block 20) was not walked; files listed only there are not reported."
extract-artifacton the same image wroteREADME.TXT,bin/setup.exeanddocs/Release Notes.txtwithcontainment_verified: true.hdiutil makehybrid -iso -jolietlisted the expected nested paths with Joliet names, and the 5,000-byte nested file's SHA-256 matched the source file.mkisofs,xorrisoand vendor installer media, and Rock Ridge or UDF hybrids, were not checked.For evidence-bearing changes:
Demo
Rendered walkthrough of the CLI inspect and extract output above (simulated terminal, values taken from a real run on the generated fixture).
Validation performed
npx --no-install vitest runover the changed test files (ISO structures, reader, reader boundaries, format recognition, target vocabularies, target diagnostics, inventory graph, Godot PCK, CLI acceptance, MCP boundary): passednpm run format:check: all matched files use the correct formatCompatibility, safety, and release
BREAKING CHANGE:artifactReaderLimitsSchemanow requiresiso9660(descriptor_count,directory_depth,record_count,directory_bytes,path_bytes), so saved Evidence records containingeffective_limitsfrom prior versions withoutiso9660will failparseInventoryPagevalidation and must be re-inspected. The only behavior change outside the new format is that ISO content now wins over a.hopfilename, and a changed image is reported as a changed source before a cached refusal (ISO and Godot PCK).AI was used for assistance.
Author readiness
Human owner: @mvanhorn
Before merge
type(scope): outcome.