Skip to content

fix: preserve safe migration causes in update failure reports - #178689

Merged
steipete merged 1 commit into
mainfrom
upd/l1730-178550
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/l1730-178550

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #178550. Update reports lose a client socket migration refusal's cause because private-path redaction removes the remainder of the warning.

User Impact

Saved and shared reports identify invalid client socket material while keeping database paths, credentials, and arbitrary exception details private.

Why This Change Was Made

The credential owner supplies a fixed error code. Schema repair places its value-free diagnosis before the private pathname, and public reporting admits only that closed vocabulary. The general path redactor remains unchanged. #178301 improved other diagnostics but did not cover this path.

Evidence

A real malformed credential migration, candidate subprocess capture, and public report regression failed before the fix with [redacted-diagnostic]. It now preserves the classified cause for a private path containing spaces. A negative control rejects arbitrary prose appended to a lookalike diagnosis. Both tests passed; the migration/report case took 1.953 seconds.

The campaign's five focused files passed 109 tests (three existing PostgreSQL skips). The required importer census covered 57 additional files in recorded discovery order; all ran, with no product failures. Eleven backup tests initially refused the host's world-writable temporary-directory ancestor. Using TMPDIR="$(getconf DARWIN_USER_TEMP_DIR)" with the guard unchanged, the complete backup file passed 32/32 (177.07 seconds wall time). The original census took 2238.53 seconds. Pre-existing file test time was 171.179 seconds for update-candidate-state.test.ts and 184.222 seconds for doctor-session-sqlite.deferred-plugin.test.ts.

Core and scoped test types, targeted oxlint/oxfmt, four changed docs' MDX checks, line-cap ratchet, and madge passed (0 cycles). Per the campaign gate budget, the full check:changed SQLite inventory was omitted for time; PR CI is the broad exact-head proof. Local tests used isolated HOME and state directories. Verification ran on the combined four-fix tree before mechanically splitting independent branches; each PR records only its own source and regression.

Isolated Codex autoreview did not produce a verdict: the private-scratch preflight failed first, and the private-directory attempt stopped during snapshot/evidence verification. No clean review is claimed; the campaign's permitted fallback is lead review of the PR head.

Focused replay (with isolated HOME/state exported):

node scripts/run-vitest.mjs src/infra/client-credential-migration-diagnostics.test.ts src/logging/diagnostic-support-redaction.test.ts --maxWorkers=1

Diff against the campaign base: Production +19/-2; tests +104/-0; docs +4/-0.

Static proof commands (all exit 0 on the combined tree):

node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
node scripts/run-tsgo.mjs -p .artifacts/tsconfig.lane.json --noEmit
node scripts/run-oxlint.mjs <changed-source-files>
node_modules/.bin/oxfmt --check <changed-files>
node scripts/check-docs-mdx.mjs <four-changed-docs>
node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts
node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base 04789278f8b0cd4cac95386ef91a37ece34082c5

Final Doctor source-inventory simplification also passed state-migrations.plan.test.ts: 7/7 tests, 129.12 seconds total (19 seconds tests, 82% transform), 137.98 seconds wrapper wall time. This is shared compiler preparation rather than slow test execution.

@clawsweeper

clawsweeper Bot commented Oct 20, 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.

@steipete
steipete marked this pull request as ready for review October 20, 2026 19:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T19:13:38.539116Z 8121855 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 812185516e16392751c3370e42163dda13efb134
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/infra/client-credential-migration-data.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/diagnostic-support-redaction.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve a fixed client socket migration diagnosis in update failure reports while continuing to redact private paths and exception details.

Example: Migration rejects socket.path=42 in /synthetic/private state/state/openclaw.sqlite.

  • Before: The public report shows [redacted-diagnostic] without the credential cause.
  • After: The public report shows Client credential socket material is invalid.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with meaningful reported regression coverage; behavioral evidence is limited to a harness.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports red/green migration-to-report regression results, and inspection confirms real owners with a synthetic subprocess rather than a shipped CLI invocation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A saved update failure report hides the credential migration cause needed to diagnose the failed update.
Reason: The maintainer-authored direction addresses a documented failure with a narrow extension of the existing privacy contract.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR addresses a verified reporting defect that remains on main, and the scoped patch has no actionable findings.

Priority: P2
Reviewed head: 812185516e16392751c3370e42163dda13efb134

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence exercises real production owners through a test harness rather than a shipped CLI update/report run.
Agent review details

How this fits together

Credential migration validates stored socket material; schema repair converts its failure into a warning, candidate capture sanitizes that warning, and report preparation projects recognized causes into public reports.

flowchart LR
  A[Stored socket material] --> B[Credential migration]
  B --> C[Schema repair warning]
  C --> D[Candidate diagnostic capture]
  D --> E[Public diagnostic projection]
  E --> F[Update failure report]
Loading

Technical review

Best possible solution:

Retain the fixed diagnosis at the migration producer and admit only that value-free diagnosis through the existing public reporting owner.

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

The report and current source establish a deterministic loss: the warning puts the cause after a private path, and conservative path redaction consumes that suffix; no target code was run during this review.

Is this the best way to solve the issue?

This is a small, complete reporting repair using existing owners: it classifies the original failure before capture and preserves the general path-redaction policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Credential migration validation keeps the original intent (8f62210: The local credential cutover validates socket credentials and projections before moving authoritative material.)
  • Schema repair failure warning keeps the original intent (73ace5d: Doctor owns historical repair and reports refusals instead of silently accepting malformed state.)
  • Public diagnostic admission keeps the original intent (fix(update): name the failing check in update failure reports #145390: Public reports expose recognized bounded causes while withholding arbitrary prose and private identifiers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f642756 adds src/logging/diagnostic-support-redaction.ts:525 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/logging/diagnostic-support-redaction.ts)
  • Dallin Romney: Raw commit 6a86065 adds src/logging/diagnostic-support-redaction.ts:444 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 6a86065d7867; files: src/logging/diagnostic-support-redaction.ts)

PR surface

Source +17, Tests +104, Docs +4. Total +125 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 19 2 +17
Tests 1 104 0 +104
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 127 2 +125

Labels

Label changes:

  • add P2: The patch restores useful diagnosis for a bounded update-failure case without changing whether migration succeeds.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The patch restores useful diagnosis for a bounded update-failure case without changing whether migration succeeds.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 October 20, 2026, 3:17 PM ET / 19:17 UTC.

@steipete
steipete merged commit 097a2f7 into main Oct 20, 2026
256 of 257 checks passed
@steipete
steipete deleted the upd/l1730-178550 branch October 20, 2026 22:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
… reports (openclaw#178689)

Fixes openclaw#178550. Shared-state schema repair failures now carry a fixed public diagnosis that survives report redaction; private exception details stay local (openclaw#145390 allowlist unchanged).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: S 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.

[Bug]: Update report redacts the shared-state migration cause together with the database path

1 participant