Skip to content

fix(tar): require both end-of-archive blocks for complete coverage - #14884

Merged
vincentkoc merged 2 commits into
morluto:mainfrom
ShuaixinHuang:fix/tar-require-complete-end-marker
Nov 27, 2026
Merged

vincentkoc merged 2 commits into
morluto:mainfrom
ShuaixinHuang:fix/tar-require-complete-end-marker

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A tar cut immediately after its first 512-byte zero block was reported as a complete inventory. This fix requires the two zero blocks specified by the tar format before claiming complete coverage. Previously inventoried members remain available when the second block is missing, short, or non-zero.

Behavior and scope

  • Missing or short second block yields end_state: truncated; a full non-zero second block yields end_state: malformed.
  • The existing coverage contract projects both outcomes as unknown. The end offset still locates the first zero block. Trailing non-zero data is still counted, and gzip carrier diagnostics remain active.
  • The owning tar reader serves the shared artifact workflow for stored and gzip tar. No interface or schema additions. No linked issue. This was found while validating the tar reader and is separate from the gzip header acquisition fix in fix(tar): recognize gzip archives with long extra fields #14861.

Validation

  • Four initial regressions failed on main 16af28c09, with end-marker where truncated was expected.
  • 155 focused tests passed and two existing tests skipped. Seven compiled CLI acceptance tests passed with the local harness scratch directory redirected from the full filesystem to shared memory. That harness adjustment is outside the diff.
  • The built CLI inspected a GNU tar 1.35 ustar fixture containing a.txt. The intact archive returned complete and end-marker. Both stored and gzip copies cut after the first zero block returned unknown and truncated, with a.txt still listed. GNU tar independently reported a lone zero block on the cut fixture.
  • TypeScript production build, runtime bundle, architecture guards, and diff whitespace checks passed. No platform-specific claims.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; the previous documentation finding is fixed.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous documentation finding is fixed.

Summary

The PR requires two full zero blocks before reporting complete tar coverage. The latest change updates the guide to match.

  • Tar inventories check two zero blocks before reporting complete coverage.

Reviews (2) · Last reviewed commit: "docs(tar): explain complete and incomple..." · Reviewed by Greptile

Comment thread src/artifacts/tar/TarWalk.ts Resolved
@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 27, 2026 10:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 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-27T10:13:31.666088Z 413f1bd Draft marked ready
ℹ️ 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.

@vincentkoc
vincentkoc merged commit fb27ba2 into morluto:main Nov 27, 2026
40 checks passed
@vincentkoc

Copy link
Copy Markdown
Collaborator

Thanks! Merged with the missing, short, and non-zero end-marker cases covered; CI and review are clean.

vincentkoc added a commit that referenced this pull request Nov 27, 2026
…pgp-633-20261127

* commit '3097263763611eb0c32c502d5a222060cf02f468':
  fix(cli): describe universal Mach-O slice selection without a single-dash flag (#14912)
  fix(iso9660): read Joliet trees whose .. records name their own directory (#14817)
  feat(gpu)!: add per-call object, work, report, metadata, structure, and parser budgets to inspect_gpu_code_objects (#14882)
  fix(macho)!: select arm64e.x1 slices of universal Mach-O files by exact subtype (#14881)
  refactor(views): share bounded parent and report limitations (#14902)
  refactor(desktop): share XML parent pointers in task drafts (#14905)
  feat(ghidra): define function-pointer members and typedefs (#14889)
  refactor(setup): share publication destination checks (#14904)
  perf(ci): skip unused test runtime uploads (#14903)
  fix(nuget): preserve explicitly spaced publisher metadata (#14906)
  fix(artifacts): keep uImage coverage unknown when bytes follow the declared payload (#14896)
  fix(artifacts): report incomplete Android sparse coverage (#14883)
  fix(tar): require both end-of-archive blocks for complete coverage (#14884)
  refactor(views): centralize indexed row paging (#14878)
  refactor(views): reuse optional filters in report projections (#14877)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants