Skip to content

Harden CLI tar archive metadata - #38

Merged
VladimirBrejcha merged 5 commits into
mainfrom
codex/rr22-cli-tar-metadata
Aug 31, 2026
Merged

Harden CLI tar archive metadata#38
VladimirBrejcha merged 5 commits into
mainfrom
codex/rr22-cli-tar-metadata

Conversation

@VladimirBrejcha

Copy link
Copy Markdown
Contributor

What changed

CLI tarballs now use portable USTAR headers, numeric root ownership, and Darwin-gated suppression of COPYFILE/xattr metadata. The package contract reads raw tar blocks and PAX bodies so hidden AppleDouble or host metadata cannot pass behind filtered tar listings. The existing docs/package suite now runs in both hosted Ubuntu and macOS jobs without changing their time budgets.

This addresses the interaction among source xattrs, tar implementation defaults, host ownership, and listing behavior without introducing a second packaging path.

How you verified

  • npm run test:docs (43/43)
  • npm test
  • ./scripts/validate.sh
  • focused raw archive and workflow assertions
  • repository and staged current-source public-safety audits
  • independent BSD/GNU tar portability review
  • I did not commit private paths, credentials, generated Xcode projects, local broker state, release assets, or task-session artifacts

Notes

USTAR limits are intentional for this small payload. Complete archive bytes are not asserted identical across operating systems because timestamp and traversal-order normalization are outside this change; raw structure and ownership are enforced instead.

Why:
- macOS COPYFILE and xattr behavior can add hidden AppleDouble and PAX records while ordinary tar listings conceal them.
- Release archives must not expose host ownership or depend on one tar implementation.

Changed:
- Create portable USTAR CLI archives with normalized numeric ownership and Darwin-gated metadata suppression.
- Validate raw tar headers, PAX records, safe paths, exact USTAR markers, and trailers with fail-closed negative fixtures.
- Run the package/docs contract on hosted macOS as well as Ubuntu and document the cross-host contract.

Verification:
- node --test --test-name-pattern=SB-PKG-CLI-003 docs/test/front-door.test.mjs
- npm run test:docs
- npm test
- ./scripts/validate.sh
- npm run agent:verify -- --profile spec-only --paths scripts/package_cli.sh docs/test/front-door.test.mjs spec/build-and-test.md .github/workflows/ci.yml --session-dir task-sessions/rr22-cli-tar-metadata-20260831
- npm run verify:public-surface
- staged current-source audit and independent portability review

Affected:
- .github/workflows/ci.yml
- docs/test/front-door.test.mjs
- scripts/package_cli.sh
- spec/build-and-test.md

Refs:
- https://how.complexsystems.fail

Session:
- task-sessions/rr22-cli-tar-metadata-20260831
@VladimirBrejcha VladimirBrejcha added the autopilot:on Enable Autopilot processing for this PR label Aug 31, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T14:53:37.913364Z b698d6a 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.

@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

@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: 0fe0b0b61e

ℹ️ 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 scripts/package_cli.sh Outdated
Comment thread scripts/package_cli.sh Outdated
@VladimirBrejcha VladimirBrejcha added autopilot:on Enable Autopilot processing for this PR and removed autopilot:on Enable Autopilot processing for this PR labels Aug 31, 2026
Why:
- Resolve actionable GitHub review feedback for PR #38.

Changed:
- Fixed both actionable review threads: CLI packaging now selects `--no-mac-metadata` and `--no-xattrs` from tar capability probes instead of `uname`, and it excludes or refuses pre-existing AppleDouble `._*` entries before writing the checksum. The Codex summary comment and review-body wrapper are non-actionable.

Verification:
- npm test

Affected:
- .github/workflows/ci.yml
- docs/test/front-door.test.mjs
- scripts/package_cli.sh
- spec/build-and-test.md

Refs:
- #38
- #38 (comment)
- #38 (comment)

Session:
- task-session: [controller artifact: jobs/pr-38/20260831-205047-0103f542-21fa-4361-a228-82ef2f2beb72/task-session]
- report: [controller artifact: jobs/pr-38/20260831-205047-0103f542-21fa-4361-a228-82ef2f2beb72/report.md]
@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

  • Source: Harden CLI tar archive metadata #38 (comment)
    This comment is a Codex review-status summary, not a review finding. The completed Code Review on 0fe0b0b does not include defects or suggestions in this comment; the actionable notes are on the review threads.
  • Source: Harden CLI tar archive metadata #38 (review)
    This review body is the Codex review wrapper for commit 0fe0b0b and does not contain inline suggestions. The actionable findings are tracked on the individual review threads.

@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: 30ed81571f

ℹ️ 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 scripts/package_cli.sh Outdated
@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

  • Source: Harden CLI tar archive metadata #38 (comment)
    This comment is a Codex review-status summary, not a review finding. The completed Code Review on 30ed815 does not include defects or suggestions in this comment; the actionable notes are on the review threads.
  • Source: Harden CLI tar archive metadata #38 (review)
    This review body is the Codex review wrapper for commit 30ed815 and does not contain inline suggestions. The actionable findings are tracked on the individual review threads.

Why:
- Tar implementation, host metadata, and stale output state can combine to publish misleading or non-portable CLI release bytes.
- AppleDouble inputs must fail visibly instead of disappearing behind archive exclusions.

Changed:
- Classify stable GNU tar and bsdtar version identities before staging and select implementation-specific ownership and metadata flags.
- Reject source and staged AppleDouble paths, clear stale final outputs, and validate a private candidate before checksum and publication.
- Share one raw USTAR validator between production packaging and docs regressions, with fail-closed fixtures for unknown tar, cross-host selection, unsafe metadata, and invalid candidates.
- Update the specs manifest and CLI archive contracts for the new production validator and failure boundary.

Verification:
- Focused CLI package contract: 7/7 passed.
- npm run test:docs: 48/48 passed.
- npm test: broker-core 294/294, client 257/257, harness adoption 24/24, app 171/171.
- ./scripts/validate.sh passed.
- npm run agent:verify -- --profile spec-only --paths .agents/manifests/specs.yaml .github/workflows/ci.yml scripts/package_cli.sh scripts/validate_cli_tar.mjs docs/test/front-door.test.mjs spec/build-and-test.md spec/project-structure.md --session-dir task-sessions/rr22-cli-tar-metadata-20260831 passed.
- Public surface scanned 261 files; staged current-source audit and semantic exact-diff review passed.

Affected:
- .agents/manifests/specs.yaml
- docs/test/front-door.test.mjs
- scripts/package_cli.sh
- scripts/validate_cli_tar.mjs
- spec/build-and-test.md
- spec/project-structure.md

Refs:
- #38
- #38 (comment)
- #38 (comment)
- #38 (comment)
- https://how.complexsystems.fail

Session:
- task-sessions/rr22-cli-tar-metadata-20260831
@VladimirBrejcha VladimirBrejcha removed the autopilot:on Enable Autopilot processing for this PR label Aug 31, 2026
@VladimirBrejcha

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 55c8f22858

ℹ️ 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 .agents/manifests/specs.yaml Outdated
Comment thread scripts/package_cli.sh
@fiveonecode-autopilot

Copy link
Copy Markdown

Autopilot needs your choice — AD-20260831-001

Review finding (External review):
The active PR changes a guarded verifier or bootstrap implementation file.
Autopilot will not run HEAD verifier code or HEAD bootstrap until this exact implementation identity is authorized.
Keep-blocked does not run old product source; it refuses HEAD verifier/bootstrap and does not push.

Concrete operator choices:

  • Authorize this contract change: accept HEAD implementation, then Autopilot may run HEAD verifier and HEAD bootstrap.
  • Keep blocked until HEAD reverts: leave the PR blocked; Autopilot must not push, must not run HEAD bootstrap, and must not run HEAD verifier.

Implementation identity (paths and blob SHAs):
.agents/manifests/specs.yaml@c963d1aa06dac6001c18d3adb7a040145b67765e..c2fbd0a177c34dbcd8e1b6cdbfa9fdb865e5bf7f

Guarded hits:

Autopilot's assessment:
The active PR changes a guarded verifier or bootstrap implementation file.
Autopilot will not run HEAD verifier code or HEAD bootstrap until this exact implementation identity is authorized.
Keep-blocked does not run old product source; it refuses HEAD verifier/bootstrap and does not push.

Concrete operator choices:

  • Authorize this contract change: accept HEAD implementation, then Autopilot may run HEAD verifier and HEAD bootstrap.
  • Keep blocked until HEAD reverts: leave the PR blocked; Autopilot must not push, must not run HEAD bootstrap, and must not run HEAD verifier.

Implementation identity (paths and blob SHAs):
.agents/manifests/specs.yaml@c963d1aa06dac6001c18d3adb7a040145b67765e..c2fbd0a177c34dbcd8e1b6cdbfa9fdb865e5bf7f

Guarded hits:

  • .agents/manifests/specs.yaml (base blob c963d1aa06dac6001c18d3adb7a040145b67765e, head blob c2fbd0a177c34dbcd8e1b6cdbfa9fdb865e5bf7f)

Autopilot recommends:
Authorize this verifier implementation change — Autopilot will accept this exact HEAD verifier/bootstrap implementation identity, then may run HEAD verifier and HEAD bootstrap.

Choose what Autopilot should do next:

  1. authorize-contract-change — Autopilot will accept this exact HEAD verifier/bootstrap implementation identity, then may run HEAD verifier and HEAD bootstrap.
  2. keep-blocked-until-head-reverts — Autopilot will leave the PR blocked until HEAD reverts the guarded implementation. It will not push, will not run HEAD bootstrap, and will not run HEAD verifier.

Reply with exactly one:
Autopilot decision AD-20260831-001: choose authorize-contract-change
Autopilot decision AD-20260831-001: choose keep-blocked-until-head-reverts

Local artifact: job 20260831-220345-83e204f7-03f3-4241-815a-0d1a1b1fdbc6/report.md

@VladimirBrejcha VladimirBrejcha added the autopilot:on Enable Autopilot processing for this PR label Aug 31, 2026
@VladimirBrejcha

Copy link
Copy Markdown
Contributor Author

Autopilot decision AD-20260831-001: choose authorize-contract-change

Why:
- Resolve actionable GitHub review feedback for PR #38.

Changed:
- Set published CLI tarball and checksum modes to 0644 after private candidate validation, with a packaging-test assertion and SB-PKG-CLI-004. Left the production validator on spec-only because that profile already runs the front-door tests that import it. Classified the Codex summary and parent review body as non-actionable.

Verification:
- npm test

Affected:
- .agents/manifests/specs.yaml
- .github/workflows/ci.yml
- docs/test/front-door.test.mjs
- scripts/package_cli.sh
- scripts/validate_cli_tar.mjs
- spec/build-and-test.md
- spec/project-structure.md

Refs:
- #38
- #38 (comment)

Session:
- task-session: [controller artifact: jobs/pr-38/20260831-220727-d4c6af61-171e-4259-a16f-4803c7714206/task-session]
- report: [controller artifact: jobs/pr-38/20260831-220727-d4c6af61-171e-4259-a16f-4803c7714206/report.md]
@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

Why:
- Close the remaining CLI archive review gaps without overlapping manifest ownership.

Changed:
- Route the raw CLI tar validator through the implementation profile while retaining spec path authorization.
- Normalize complete tarball and checksum candidates to mode 0644 before either final rename.
- Align the SB-PKG-CLI-004 publication contract with the atomic mode boundary.

Verification:
- Focused CLI package regressions: 7/7.
- Documentation tests: 48/48.
- Full product, app, and harness suites passed.
- Required implementation and spec-only profiles passed with the same task fingerprint.
- Staged public-source and diff audits passed.

Affected:
- .agents/manifests/implementation-foundation.yaml
- .agents/manifests/specs.yaml
- scripts/package_cli.sh
- spec/build-and-test.md

Refs:
- #38
- #38 (comment)
- #38 (comment)

Session:
- task-sessions/rr22-cli-tar-metadata-20260831
@VladimirBrejcha VladimirBrejcha added autopilot:on Enable Autopilot processing for this PR and removed autopilot:on Enable Autopilot processing for this PR labels Aug 31, 2026
@fiveonecode-autopilot

Copy link
Copy Markdown

Autopilot needs your choice — AD-20260831-002

Review finding (External review):
The active PR changes a guarded verifier or bootstrap implementation file.
Autopilot will not run HEAD verifier code or HEAD bootstrap until this exact implementation identity is authorized.
Keep-blocked does not run old product source; it refuses HEAD verifier/bootstrap and does not push.

Concrete operator choices:

  • Authorize this contract change: accept HEAD implementation, then Autopilot may run HEAD verifier and HEAD bootstrap.
  • Keep blocked until HEAD reverts: leave the PR blocked; Autopilot must not push, must not run HEAD bootstrap, and must not run HEAD verifier.

Implementation identity (paths and blob SHAs):
.agents/manifests/implementation-foundation.yaml@09d785bf4f6f9b7f01be1bffebda9a1a7fa0ffdc..ee67acf9d5d78c2010b7cf59f41f733af2e21de0;.agents/manifests/specs.yaml@c963d1aa06dac6001c18d3adb7a040145b67765e..6074926b0e0966b83bb6bd1e7d41a753eb1f0af9

Guarded hits:

  • .agents/manifests/implementation-foundation.yaml (base blob 09d785bf4f6f9b7f01be1bffebda9a1a7fa0ffdc, head blob ee67acf9d5d78c2010b7cf59f41f733af2e21de0)
  • .agents/manifests/specs.yaml (base blob c963d1aa06dac6001c18d3adb7a040145b67765e, head blob 6074926b0e0966b83bb6bd1e7d41a753eb1f0af9)
    Harden CLI tar archive metadata #38

Autopilot's assessment:
The active PR changes a guarded verifier or bootstrap implementation file.
Autopilot will not run HEAD verifier code or HEAD bootstrap until this exact implementation identity is authorized.
Keep-blocked does not run old product source; it refuses HEAD verifier/bootstrap and does not push.

Concrete operator choices:

  • Authorize this contract change: accept HEAD implementation, then Autopilot may run HEAD verifier and HEAD bootstrap.
  • Keep blocked until HEAD reverts: leave the PR blocked; Autopilot must not push, must not run HEAD bootstrap, and must not run HEAD verifier.

Implementation identity (paths and blob SHAs):
.agents/manifests/implementation-foundation.yaml@09d785bf4f6f9b7f01be1bffebda9a1a7fa0ffdc..ee67acf9d5d78c2010b7cf59f41f733af2e21de0;.agents/manifests/specs.yaml@c963d1aa06dac6001c18d3adb7a040145b67765e..6074926b0e0966b83bb6bd1e7d41a753eb1f0af9

Guarded hits:

  • .agents/manifests/implementation-foundation.yaml (base blob 09d785bf4f6f9b7f01be1bffebda9a1a7fa0ffdc, head blob ee67acf9d5d78c2010b7cf59f41f733af2e21de0)
  • .agents/manifests/specs.yaml (base blob c963d1aa06dac6001c18d3adb7a040145b67765e, head blob 6074926b0e0966b83bb6bd1e7d41a753eb1f0af9)

Autopilot recommends:
Authorize this verifier implementation change — Autopilot will accept this exact HEAD verifier/bootstrap implementation identity, then may run HEAD verifier and HEAD bootstrap.

Choose what Autopilot should do next:

  1. authorize-contract-change — Autopilot will accept this exact HEAD verifier/bootstrap implementation identity, then may run HEAD verifier and HEAD bootstrap.
  2. keep-blocked-until-head-reverts — Autopilot will leave the PR blocked until HEAD reverts the guarded implementation. It will not push, will not run HEAD bootstrap, and will not run HEAD verifier.

Reply with exactly one:
Autopilot decision AD-20260831-002: choose authorize-contract-change
Autopilot decision AD-20260831-002: choose keep-blocked-until-head-reverts

Local artifact: job 20260831-225719-526fea86-5c4c-40f8-80ad-4e93f67b1c6a/report.md

@fiveonecode-autopilot

Copy link
Copy Markdown

Autopilot recorded decision AD-20260831-002: selected authorize-contract-change.

Operator: @VladimirBrejcha

@fiveonecode-autopilot

Copy link
Copy Markdown

Reviewed top-level PR feedback and left the current code unchanged.

These items were posted as PR review bodies or conversation comments rather than unresolved review threads, so this acknowledgement is recorded on the PR timeline.

@VladimirBrejcha
VladimirBrejcha merged commit 0e12782 into main Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autopilot:on Enable Autopilot processing for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant