Skip to content

fix(package): keep postinstall inventory readable - #133500

Merged
RomneyDa merged 2 commits into
extended-stable/2026.6.33from
fix/extended-stable-2026-6-35-package-inventory-mode
Aug 30, 2026
Merged

RomneyDa merged 2 commits into
extended-stable/2026.6.33from
fix/extended-stable-2026-6-35-package-inventory-mode

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where non-root users could receive a package tarball whose postinstall inventory is owner-only, causing package validation to reject the release artifact and preventing installed-package maintenance from reading its inventory.

Why This Change Was Made

The existing package-inventory producer uses the pinned fs-safe atomic writer, whose secure default file mode is 0600. The inventory is package metadata rather than private state, so the producer now explicitly writes it as 0644; all candidate pack flows use that producer.

User Impact

The packaged inventory remains readable after normal global installation, and candidate package validation no longer rejects its tarball for an owner-only dist/postinstall-inventory.json entry.

Evidence

  • Reproduced against the frozen 782a8f7 candidate: the unmodified producer wrote mode 0600; the fix writes 0644.
  • Focused regression: node scripts/run-vitest.mjs run src/infra/package-dist-inventory.test.ts (14 passed). The added assertion fails on the pre-fix producer.
  • Focused lint: node scripts/run-oxlint.mjs --tsconfig tsconfig.json src/infra/package-dist-inventory.ts src/infra/package-dist-inventory.test.ts.
  • Verified the pinned @openclaw/[email protected] public types accept WriteJsonOptions.mode; its atomic writer applies the final mode after rename.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:47 PM ET / 20:47 UTC.

ClawSweeper review

What this changes

The PR writes the packaged postinstall inventory with mode 0644 and adds a non-Windows regression assertion for that file mode.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. The previous Windows-specific blocker is fixed, and the direct extended-stable inventory producer now requests a public package-file mode with a portable regression assertion; this maintainer-authored, protected PR still needs normal exact-head CI completion before merge.

Priority: P2
Reviewed head: fdb770bae75106bdce01f1d1bd4d698bf1cbab8e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correctly scoped repair resolves the prior platform finding; remaining confidence is limited by the unavailable direct fs-safe source inspection and incomplete exact-head checks.
Proof confidence 🌊 off-meta tidepool Not applicable: The changed production owner is the package-inventory writer, exercised by the focused file-mode assertion; the author is a repository MEMBER, so the external-contributor proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The changed production owner is the package-inventory writer, exercised by the focused file-mode assertion; the author is a repository MEMBER, so the external-contributor proof gate does not apply.
Evidence reviewed 5 items Direct producer change: The extended-stable writer now passes an explicit 0644 mode at its only inventory write, preserving the secure default for unrelated JSON files.
Portable regression coverage: The focused inventory test checks the resulting POSIX permission bits and skips Windows, matching the repository's existing platform guard for permission assertions.
Installed-package consumer: Global-install validation reads the inventory and compares it with the installed distribution contents, so readability belongs at the inventory producer boundary.
Findings None None.
Security None None.

How this fits together

The package build flow scans distribution files and writes a postinstall inventory into the package output. Package validation and installed-package maintenance then read that inventory after installation.

flowchart LR
  A[Package build] --> B[Distribution scan]
  B --> C[Inventory writer]
  C --> D[Package artifact]
  D --> E[Package validation]
  D --> F[Installed-package maintenance]
Loading

Before merge

  • Resolve merge risk (P1) - The equivalent current-main writer at scripts/lib/package-dist-inventory.ts:133 still has no explicit mode, so a separate forward-port is needed if future package artifacts use that path.
  • Resolve merge risk (P1) - The fs-safe package source was not materialized in the checkout and the remote was unreachable, preventing direct inspection of its mode implementation; the focused regression assertion and type-checked call remain the available evidence.
  • Complete next step (P2) - No mechanical repair remains on this branch: the prior Windows finding is fixed, and the remaining work is normal exact-head validation plus a separate main-line follow-up.
Agent review details

Security

None.

PR surface

Source 0, Tests +6. Total +6 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 6 0 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 7 1 +6

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the bounded extended-stable repair once exact-head checks are resolved, then apply the same explicit public-mode contract to the current-main package-inventory writer in a separate focused change.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the bounded extended-stable repair once exact-head checks are resolved, then apply the same explicit public-mode contract to the current-main package-inventory writer in a separate focused change.

Do we have a high-confidence way to reproduce the issue?

Yes—source inspection identifies the direct producer and the added POSIX assertion exercises the resulting file mode; the PR body reports that the pre-fix producer fails that assertion.

Is this the best way to solve the issue?

Yes for the extended-stable branch: set the mode at the package-metadata producer instead of weakening the secure default for every fs-safe JSON write; current main needs a separate equivalent forward-port.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 14d2cf0f5c07.

Labels

Label justifications:

  • P2: This narrowly affects package artifact readability and installed-package maintenance, without evidence of an active broad outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The changed production owner is the package-inventory writer, exercised by the focused file-mode assertion; the author is a repository MEMBER, so the external-contributor proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Forward-port the explicit mode to the current-main inventory writer if that path is used for future release artifacts.
  • Resolve or document the unrelatedness of the remaining failed exact-head check before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-30T20:28:50.510Z sha 1ff44c8 :: needs changes before merge. :: [P1] Guard the POSIX permission assertion on Windows

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@RomneyDa
RomneyDa merged commit 78b6d06 into extended-stable/2026.6.33 Aug 30, 2026
152 of 153 checks passed
@RomneyDa
RomneyDa deleted the fix/extended-stable-2026-6-35-package-inventory-mode branch August 30, 2026 22:59
RomneyDa added a commit that referenced this pull request Aug 30, 2026
* fix(package): make postinstall inventory readable

* test(package): skip inventory mode assertion on Windows

(cherry picked from commit 78b6d06)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant