Skip to content

fix(tests): support npm tar 6 and tar 7 archive parsers - #712

Closed
kamilio wants to merge 3 commits into
mainfrom
codex/archive-tar-parser-compat
Closed

fix(tests): support npm tar 6 and tar 7 archive parsers#712
kamilio wants to merge 3 commits into
mainfrom
codex/archive-tar-parser-compat

Conversation

@kamilio

@kamilio kamilio commented Sep 10, 2026

Copy link
Copy Markdown
Member

The committed-archive verifier currently fails before reading entries when the active npm installation bundles tar 6: that version exports Parse, while tar 7 exports Parser. Node 22.22.0 with npm 10.9.4 reproduces TypeError: tar.Parser is not a constructor across archive consumer checks.

Select Parser when available and otherwise use Parse. Keep the same strict parser options, byte authentication, path admission, entry restrictions, duplicate checks, and size limits.

Validation: the new in-memory regression fails for the Parse-only API before the change and passes for both constructor names afterward. It verifies admitted bytes and rejects mismatched hashes, unbound entries, traversal, symlinks, and duplicate entries. The existing archive admission control also passes. Guarded repository lint passed (10,528 files, zero errors/warnings, 25 boundary receipts). A separate exact-byte probe also passed with the actual installed tar 6.2.1 and tar 7.5.22 packages.

The wider archive-control suite passed 186 of 187 cases; its sole failure was a missing generated safe-fs declaration in the fresh checkout. After the maintained selected safe-fs build, that unchanged case passed. No fixture or policy was changed to resolve it.

This is a test-tool compatibility fix; it does not change shipped runtime code or relax archive policy. It is separate from the atomic resize feature in #711.

The follow-up wires both parser regressions into the maintained integration entrypoint. A discovery check found zero parser cases before that import; the same entrypoint now discovers and passes both cases (2/2). Guarded repository lint again passed with zero errors or warnings.

The isolated launcher fixture also registers the parser-test module so the clean and poisoned startup controls reach their synthetic verifier. The exact missing-module failure was reproduced before this fixture correction; the launcher and both real parser safety controls then passed together (3/3). Guarded lint passed again (10,528 files, zero errors/warnings, 25 receipts).

Screenshots

Recorded local test-tool verification: actual npm tar 6.2.1 Parse and workspace tar 7.5.22 Parser both passed exact-byte probes. Not production or product UI evidence.

Evidence 1

Import the tar Parse/Parser regression from the maintained integration entrypoint so normal test discovery executes both compatibility cases.

Validation: maintained entrypoint discovers and passes both parser cases (2/2); guarded repository ESLint passes 10,528 files with zero errors or warnings.

Tests: archive admission preserves safety with the Parse and Parser tar APIs; both verify exact archived bytes and archive safety checks.
Include the parser-test module beside the copied outer launcher so its
startup-environment control reaches the synthetic verifier after parser
regressions are registered by the maintained test entrypoint.

### Tests Updated

| Test | Verifies |
| --- | --- |
| maintained outer launcher rejects inherited startup settings before the verifier starts | Both baseline and poisoned environments reach the verifier without executing inherited startup code. |

Validation: exact missing-module reproduction failed before the fixture
addition; launcher and actual Parse/Parser archive-safety controls pass 3/3.
@kamilio

kamilio commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Cherry-picked archive parser compatibility and discovery/fixture refinements as b7aafbf, d2e0f32 and 2edd270.

Verified on remote main at 4da2a66 after local validation and final installed-package qualification. Closing after cherry-pick/reconciliation rather than merging obsolete branch history.

Release is in progress: https://github.com/poe-platform/poe-code/actions/runs/34500155547 ; scoped packages: https://github.com/poe-platform/poe-code/actions/runs/34500155125 .

@kamilio kamilio closed this Sep 10, 2026
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.

1 participant