Skip to content

feat(artifacts): inventory NTFS MFT record headers - #9911

Merged
gensokyo-dev merged 26 commits into
mainfrom
fix/9867-ntfs-inventory
Nov 11, 2026
Merged

gensokyo-dev merged 26 commits into
mainfrom
fix/9867-ntfs-inventory

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

An acquired NTFS MFT could not be opened through the public artifact workflow. This adds offline CLI/MCP admission and a read-only MFT header inventory, reusing @2SinceJuly's reader from #9868 with original authorship. Part of #9867.

  • Return aggregate counts and the first 32 headers with source offsets, an omitted-header count, full file references, exact log sequence numbers and per-record fixup facts.
  • Preserve contradictory extents and declared record identities with unknown coverage. Accept the older 42-byte header and expose unknown flag bits.
  • Verify update-sequence bounds and reserved values, and count mismatches independently of uncovered sectors.
  • Buffer the input once and retain a bounded header sample. Publish after source validation, retry interrupted preparation, and revalidate cached traversals.

The whole-file admission ceiling is 512 MiB. Attribute and USN analysis are follow-up work in #9914. All fixtures are synthesized. Real Windows acquisitions remain unverified.

Validation on Node 24.22.1, with one test worker and bounded V8 heaps:

  • Typecheck, targeted lint/formatting, build:cached and docs:check passed. Lint reports size/complexity warnings.
  • At eaff61f, 130 focused tests passed across public CLI/MCP admission, target schemas, decoder, reader and classification, including source mutation after cached preparation.
  • Packaged CLI admission passed at 872fae0. The build and docs checks, including 9 README consistency tests, passed at eaff61f.

Memory comparison, one cold process per revision on one CPU with a 1 GiB heap cap: a 32 MiB synthesized MFT containing 65,536 records produced identical metadata at 519e800 and b7dee37. Decoder elapsed time was 324 → 201 ms, CPU 323 → 201 ms, and process peak RSS 198,764 → 156,252 KiB. Startup contributes to peak RSS. Warm runs, full CLI/MCP performance and agent-token costs were not measured.

CI source tests passed 26,594 tests and failed only on an empty suite in src/ghidra/GhidraFunctionValues.test.ts. That file is unchanged by this PR. A clean detached worktree at main e2585aa reproduced the same “No test found in suite Ghidra bridge script processor context contract” failure with 106 passing tests. This is a verified base-branch failure. CI job: https://github.com/morluto/rea/actions/runs/42939623493/job/130264057014 .

2SinceJuly and others added 5 commits November 11, 2026 00:27
An acquired $MFT stream had no reader, so an analyst holding one could only
treat it as an opaque file. Recognize the FILE signature of the first record
and inventory every record's header: sequence number, flags, used and total
bytes, base record reference and update-sequence array.

Each record's update-sequence fixups are verified against its sector
trailers. A mismatch keeps the header facts, is reported on the record and is
counted in the metadata, so a record that was not cleanly written is visible
rather than silently accepted. A missing or short array is reported as
unverified, a wrong signature stops the scan at its offset, and a trailing
partial record is reported as a byte count. Attributes, filenames and the
$UsnJrnl:$J journal are not decoded, so no path or change history is claimed.

Part of #9867

(cherry picked from commit ccb45f5)
The new NTFS $MFT files were committed unformatted, so the Static checks lane
failed on format:check. Formatting only; no behaviour change.

(cherry picked from commit dc6a6d4)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T01:34:55.756738Z eaff61f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@N0zoM1z0
N0zoM1z0 enabled auto-merge (rebase) November 11, 2026 00:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a110d2a74b

ℹ️ 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".

Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4bb6563b7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/artifacts/NtfsMftArtifactReader.ts Resolved
Comment thread src/artifacts/NtfsMftArtifactReader.ts Resolved
Comment thread src/artifacts/NtfsMftArtifactReader.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2baf11f3a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 519e800cd8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7dee37751

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/windows/ntfsMft.ts Resolved
@N0zoM1z0
N0zoM1z0 disabled auto-merge November 11, 2026 01:06
@N0zoM1z0
N0zoM1z0 enabled auto-merge (rebase) November 11, 2026 01:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 872fae00d8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved
@N0zoM1z0
N0zoM1z0 disabled auto-merge November 11, 2026 01:15
@N0zoM1z0
N0zoM1z0 enabled auto-merge (rebase) November 11, 2026 01:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8edb1c78a2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/windows/ntfsMft.ts Resolved
Comment thread src/domain/windows/ntfsMft.ts Resolved
@N0zoM1z0
N0zoM1z0 disabled auto-merge November 11, 2026 01:24
@N0zoM1z0
N0zoM1z0 enabled auto-merge (rebase) November 11, 2026 01:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d025ddfad6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/artifacts/NtfsMftArtifactReader.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants