Skip to content

fix(pr): hash captured snapshots through read-only stdin - #173899

Merged
vincentkoc merged 2 commits into
mainfrom
fix/pr-snapshot-hash-stdin-20261016
Oct 16, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/pr-snapshot-hash-stdin-20261016

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Captured-evidence hashing in PR correction admission currently feeds Git through a synchronous pipe; this change gives that boundary a complete, closed byte snapshot. A reported publication stall motivated the repair, but its historical cause remains unproven.

User Impact

No product-facing behavior changes. PR tooling hashes the same captured evidence bytes without rereading the original authority path. Write hashes, signatures, authority checks, locks, and transport remain unchanged.

Why This Change Was Made

Read-only hashes now use an exclusive private snapshot, close the writer, and open a fresh read-only descriptor at offset zero. On supported POSIX hosts, the pathname and directory are removed before the selected Git executable starts.

Temporary disk must fit the largest captured file. Unlinking is not secure erasure; abrupt termination before unlink can leave private snapshot data. Windows is not qualified by this change.

Evidence

  • Five focused changed-input tests passed: byte-equivalent empty, invalid-UTF-8, newline-sensitive and 32 MiB inputs; independence from later original-path mutation; fail-closed write/spawn/Git errors; native cancellation cleanup; both supervised correction callers and authority-mutation rejection.
  • Seven native publication/signature tests passed, including rejection of unsigned task commits and invalid baseline authority.
  • Targeted tooling types, script/test lint, four-file formatting, and whitespace checks passed.
  • An unmodified-base negative control rejected pipe stdin, establishing the new descriptor contract, not reproducing the historical stall.
  • Earlier 32-case baseline results are historical; their combined invocation failed and they are not claimed as final-byte passes. CI and native exact-head review remain pending.

Production delta: +35/-6 lines; tests: +272 lines; documentation: +13 lines. The added production lifecycle owns exclusive snapshot creation, descriptor closure, and cleanup without changing admission authority.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Oct 16, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 16, 2026 06:20
@vincentkoc
vincentkoc enabled auto-merge (squash) October 16, 2026 06:21
@clawsweeper clawsweeper Bot added 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. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR passes captured evidence bytes to Git through an unlinked read-only temporary file instead of a synchronous stdin pipe.

Example: Correction admission hashes a captured 32 MiB evidence file on POSIX.

  • Before: Git receives the captured bytes through a synchronous pipe.
  • After: Git reads the same bytes from a private, complete, unlinked file descriptor positioned at offset zero.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused implementation with meaningful boundary coverage and no discrete defect found; evidence supports the transport contract rather than the historical stall diagnosis.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supporting evidence is reported production-helper and supervision test coverage, with no linked live publication artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Maintainers reported a publication stall while correction admission was hashing captured evidence, although its cause remains unknown.
Reason: The feature owner has chosen a bounded transport improvement with explicit tradeoffs, without presenting it as a proven repair for the historical stall.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused tooling improvement, and no introduced correctness defect was identified; required CI remains red.

Priority: P2
Reviewed head: 2bba9a81984b67685c040e121c9d97b6adea620d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied tests establish the descriptor contract and admission behavior, but no shipped publication trace reproduces and resolves the historical stall.
Agent review details

How this fits together

Native PR correction tooling captures review and baseline evidence, hashes it with the selected Git executable, and compares the resulting object IDs during admission.

flowchart LR
A[Captured evidence bytes] --> B[Hash owner]
B --> C[Private temporary snapshot]
C --> D[Unlinked read-only descriptor]
D --> E[Git hash-object]
E --> F[Admission identity checks]
Loading

Technical review

Best possible solution:

Retain the focused hash transport change while preserving exact evidence bytes and existing admission authority.

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

The historical publication stall is not reproduced: the body explicitly limits its negative control to rejecting pipe stdin, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The implementation coherently replaces read-only hash transport within its existing owner, preserves Git hashing semantics, and documents its accepted disk and interruption costs.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Captured baseline evidence hashing keeps the original intent (da63d5f: Baseline refresh binds exact captured evidence to signed correction candidates while preserving review authority; the prior PR gives no special requirement for pipe transport.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit da63d5f adds scripts/pr-lib/baseline-refresh.mjs:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: da63d5f71f9c; files: scripts/pr-lib/baseline-refresh.mjs)
  • Peter Steinberger: Raw commit aea10c9 adds docs/reference/scripts/pr-tooling.md:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: aea10c9d20e4; files: docs/reference/scripts/pr-tooling.md)

PR surface

Tests +272, Docs +13, Other +29. Total +314 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 272 0 +272
Docs 1 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 1 35 6 +29
Total 4 320 6 +314

Review metrics

Metric Value Why it matters
Production versus test growth Production +35/-6 lines; tests +272 lines Production growth owns snapshot lifecycle and cleanup; test growth exercises distinct byte, failure, cancellation, and supervised admission contracts.

Labels

Label changes:

  • add P2: This is a bounded maintainer-tooling improvement without an established urgent product regression.
  • 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: This is a bounded maintainer-tooling improvement without an established urgent product regression.
  • 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 16, 2026, 2:34 AM ET / 06:34 UTC.

@vincentkoc
vincentkoc disabled auto-merge October 16, 2026 06:38
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 16, 2026
@vincentkoc
vincentkoc merged commit 6598d8b into main Oct 16, 2026
100 checks passed
@vincentkoc
vincentkoc deleted the fix/pr-snapshot-hash-stdin-20261016 branch October 16, 2026 06:52
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…3899)

* fix(pr): hash captured snapshots through read-only stdin

* fix(ui): remove unused LitContent import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui 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. scripts Repository scripts size: M 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