Skip to content

fix(update): retain local package errors and preserve public report privacy - #194160

Merged
roboclaw-bot merged 2 commits into
mainfrom
roboclaw/nd-update-exception-evidence
Nov 6, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
roboclaw/nd-update-exception-evidence

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Package-update failures can discard the original exception and recommend changing install-root permissions without identifying the denied path.

User Impact

openclaw update status --json and retained local diagnostics keep bounded exception evidence: name, code, errno, syscall, path/dest, truncated message, first OpenClaw source frame, and two nested causes. Existing local redaction and bounds remain in force.

Public GitHub reports retain only recognized codes/causes, admitted source locations, and privacy-safe guidance through the existing public projection. Arbitrary customer names, business context, and other exception prose stay local. A static notice points to local status when message details are omitted.

Unknown/outside-path EACCES/EPERM no longer produces install-root chmod/ownership advice; known install-root permission failures retain their advice.

Why This Change Was Made

The package/staging catches pass their original exception to src/infra/package-update-manager-preflight.ts:311. Previously classification replaced stderr and substituted the global root when no denied path was available. Capture bounded facts before classification using src/infra/update-failure-facts.ts:206, preserve original stderr, and require a reported path inside the install root for permission repair advice.

All exception facts use redactPublicSupportDiagnosticLine in src/infra/update-failure-report-prepare.ts:322. This preserves the public diagnostic admission intent of f642756: pattern-based local sanitization does not authorize publishing arbitrary prose. There is no errorName/check exception to the public projection.

The installed updater must contain this repair to retain future evidence. This does not identify or fix the reporter's underlying macOS EACCES, and cannot recover exceptions discarded by older updaters. No schema/protocol bump or CHANGELOG changes.

Refs #194143 #194016 #194035 #194104

Evidence

  • Accepted the P1 privacy finding on 1892a862. Ten package-boundary cases failed there because public reports contained local exception text, including synthetic customer/business prose without tokens or home paths in both direct facts and recorded-step reconstruction. The generic report test also failed its missing-local-guidance assertion.
  • timeout 120s node scripts/run-vitest.mjs src/infra/package-update-permissions.test.ts src/infra/update-failure-report-prepare.test.ts --maxWorkers=1: 89 passed (13 package-boundary + 76 public-report tests), 44.88 seconds wall time including cold worker preparation. File durations: 2.57 seconds and 39.23 seconds respectively; actual tests under one second per file. Per-file CI timings not yet collected.
  • timeout 120s node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json --threads=1 --type-check <three repair-touched TypeScript files>: passed. Touched-file oxfmt and git diff --check: passed.
  • One independent shared autoreview/Codex pass, P0–P2, complete candidate against 5c3103434832: only an INDEX-only finding that the index still held the old renderer. Resolved by staging the reviewed working-tree correction and verifying byte equality for every repair-touched file. No additional P0–P2 working-tree findings were reported. No hosted re-review requested; parent handles that review.
  • Simplification complete: this repair removes the public bypass and adds only static local guidance. Full PR: +62 net production lines, +169 test lines. Scoped allocation is exactly 169 lines (28 added in this repair); shared scalar unchanged and no inherited-debt credit.
  • Exact-head CI for 7b5c1ffa39b9 is running; no current-head failures observed at handoff. Prior-head CI is not claimed as proof for this revision.
  • No live Gateway changes, broad local suites, or shipped CLI/Gateway/Darwin reproduction. Focused in-process boundary evidence proves diagnostic retention, public privacy, and permission advice, not the underlying macOS denial.

Retain sanitized exception facts through package-update reports and status. Require a reported path inside the install root before offering permission repair advice.

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR preserves package-update exceptions and limits directory permission advice to failures with a known path inside the install root.

Example: Candidate validation throws EACCES without a path while updating an npm installation under /opt/homebrew/lib/node_modules.

  • Before: The updater substitutes the install root, recommends chmod, and discards the original exception details.
  • After: The updater retains bounded exception facts and reports that the denied path is unknown.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful diagnostic repair with meaningful boundary tests, blocked by a public-data disclosure regression and missing shipped-entry-point proof; existing optional fact fields and bounds remain unchanged.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Failed updates hide the original error and can recommend changing permissions on a directory that was never identified as the denied location.
Reason: The reporting defect is source-confirmed and supported by reporter evidence; maintainer authorship establishes direction, while the underlying macOS update failure remains separate.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it addresses a source-confirmed diagnostic defect, but its public-report change exposes arbitrary exception text and needs correction before merge.

Priority: P2
Reviewed head: 1892a862ba6b28995d6dd3f567942b313369a725

Before merge

  • Keep package exception messages behind the public diagnostic projection (P1) - When the package catch receives an exception containing private prose, this branch copies its message into the public GitHub report merely because errorName is present. For example, an exception message Validation refused for customer AcmeInternal survives createUpdateFailureFact: the local sanitizer removes recognized paths, hosts, and credential patterns, but cannot identify arbitrary customer names or private rejected values. The new branch then publishes that text, and prepareGithubIssue only bounds and marks the body. Previously redactPublicSupportDiagnosticLine excluded such prose by construction, an intentional boundary documented in fix(update): name the failure cause in generated reports without exposing private data #178301. Keep detailed exceptions in local status, project only safe structured metadata and recognized causes publicly, and cover private prose in both direct and recorded package facts.
  • Resolve security concern: Local diagnostics cross the public reporting boundary - User review of the generated report remains required, but it does not preserve the established guarantee that arbitrary diagnostic prose stays local.
  • Explain or restore the original intent of Public diagnostic admission - f642756: Expose recognized causes while deliberately keeping arbitrary prose and private identifiers local; the PR does not explain why pattern sanitization now safely replaces that boundary.

Findings

  • [P1] Keep package exception messages behind the public diagnostic projection — src/infra/update-failure-report-prepare.ts:323-325
  • [medium] Local diagnostics cross the public reporting boundary — src/infra/update-failure-report-prepare.ts:324

Provenance

  • Public diagnostic admission changes intended behavior without addressing why it exists (f642756: Expose recognized causes while deliberately keeping arbitrary prose and private identifiers local; the PR does not explain why pattern sanitization now safely replaces that boundary.)

Tests

  • Missing end-to-end proof: Supply a redacted shipped CLI or Gateway failure trace showing retained local diagnostics, correct permission guidance, safe public projection, and unchanged existing settings across an update.
Agent review details

How this fits together

The package updater classifies staging and validation failures, records diagnostic facts for update status, and projects selected facts into a user-reviewed GitHub report.

flowchart LR
  A[Package staging and validation] --> B[Exception classification]
  B --> C[Bounded failure facts]
  C --> D[Update status and ledger]
  D --> E[Public report projection]
  E --> F[Report preview and submission]
Loading

Technical review

Best possible solution:

Retain bounded original exceptions locally while publishing only explicitly safe diagnostic fields and recognized causes through the existing public projection.

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

Current-main source establishes loss and misattribution of pathless permission exceptions; the reported macOS failure itself was not reproduced, and no target code ran during this review.

Is this the best way to solve the issue?

Capturing exceptions before classification and removing fallback directory attribution are focused repairs, but local sanitization cannot replace the existing public diagnostic allowlist.

Full review comments:

  • [P1] Keep package exception messages behind the public diagnostic projection — src/infra/update-failure-report-prepare.ts:323-325
    When the package catch receives an exception containing private prose, this branch copies its message into the public GitHub report merely because errorName is present. For example, an exception message Validation refused for customer AcmeInternal survives createUpdateFailureFact: the local sanitizer removes recognized paths, hosts, and credential patterns, but cannot identify arbitrary customer names or private rejected values. The new branch then publishes that text, and prepareGithubIssue only bounds and marks the body. Previously redactPublicSupportDiagnosticLine excluded such prose by construction, an intentional boundary documented in fix(update): name the failure cause in generated reports without exposing private data #178301. Keep detailed exceptions in local status, project only safe structured metadata and recognized causes publicly, and cover private prose in both direct and recorded package facts.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ed3c5dadbdbb.

Provenance checked

  • Permission classification and directory advice keeps the original intent (80b9230: Provide actionable permission failures and safe recovery without replacing another installation.)
  • Original exception capture keeps the original intent (a2e4ebe: Retain bounded, redacted unexpected-error facts through existing update diagnostics.)

Testing

Proof path: in-process harness.

Security

Needs attention: Public package-error reports can disclose private exception prose despite pattern-based sanitization.

Evidence

Security concerns:

  • [medium] Local diagnostics cross the public reporting boundary — src/infra/update-failure-report-prepare.ts:324
    User review of the generated report remains required, but it does not preserve the established guarantee that arbitrary diagnostic prose stays local.
    Confidence: 0.99

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f642756 adds src/infra/update-failure-report-prepare.ts:316 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6427568d96d; files: src/infra/update-failure-report-prepare.ts)
  • RoboClaw: Raw commit 18fb74f adds src/infra/update-failure-report-prepare.ts:147 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 18fb74fb173e; files: src/infra/update-failure-report-prepare.ts)

PR surface

Source +56, Tests +141, Other +2. Total +199 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 70 14 +56
Tests 1 141 0 +141
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 213 14 +199

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression growth Production +70/-14; tests +141/-0 Growth captures exception metadata through existing owners and exercises staging, validation, permission attribution, and report reconstruction without introducing a new storage model.

Labels

Label changes:

  • add P2: This is a focused diagnostic repair for failed updates; it does not repair the underlying update failure.
  • add merge-risk: 🚨 security-boundary: The changed public renderer bypasses an intentional privacy projection and admits arbitrary exception prose into GitHub reports.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a focused diagnostic repair for failed updates; it does not repair the underlying update failure.
  • merge-risk: 🚨 security-boundary: The changed public renderer bypasses an intentional privacy projection and admits arbitrary exception prose into GitHub reports.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 6, 2026, 9:17 AM ET / 14:17 UTC.

Restore the existing public diagnostic projection for every exception fact. Keep bounded original evidence local and point operators to local status for omitted details.

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>
@roboclaw-bot roboclaw-bot changed the title fix(update): keep the original error in package-update failure reports fix(update): retain local package errors and preserve public report privacy Nov 6, 2026
@roboclaw-bot
roboclaw-bot merged commit 2a2cd29 into main Nov 6, 2026
135 of 137 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/nd-update-exception-evidence branch November 6, 2026 15:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…rivacy (openclaw#194160)

Package-update failures now keep a bounded, sanitized record of the original exception (name, code, errno, syscall, path, truncated message, first OpenClaw frame, two nested causes) in local update status and diagnostics. Public generated reports keep the existing public diagnostic projection, so arbitrary exception prose stays local. Install-root ownership/chmod advice is given only when the failing path is known and lies under the install root.

Refs openclaw#194143 openclaw#194016 openclaw#194035 openclaw#194104

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant