Skip to content

fix(review): retain late proof from long item bodies - #1269

Merged
steipete merged 2 commits into
mainfrom
steipete/proof-context-20260827
Aug 28, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/proof-context-20260827

Conversation

@steipete

@steipete steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where ClawSweeper could miss later real-behavior evidence in long primary issue/PR bodies. A fresh full-source hash did not mean the reviewer received that evidence: hydration kept only the opening 12,000 UTF-16 units, which could show early supplemental mocks while omitting later runtime traces.

Real Behavior Proof

Head: e511af1c41f10b6b3837c709e2f1e3c81ae97f93.

Claim and exercised surface: The real raw-body → collectItemContext → primary compaction → final review-prompt JSON path delivers bounded verbatim late evidence and explicitly reports omitted text. Full-source freshness is preserved. PR patches and supplemental excerpts remain reviewer input, not automatic media-download input; primary body/comment media retains its existing behavior.

Scenario: A self-contained 60,641-unit input has early supplemental mock text, an inert native-proof heading at 14,235, and an inert HTTP/native-row trace at 19,562. Only GitHub transport is supplied locally; the production compactor, renderer, and media owner are real. Media transport is a recording-only runner that performs no network I/O.

Commands and environment: Executed after committing the head above, with Node 26.7.0, pinned pnpm 11.10.0, Bash 5.3.15, and macOS arm64. Provider is local-process; no container image or lease.

pnpm run build
node scripts/e2e/proof-context.ts

Observed receipt summary: Both issue and PR scenarios passed. Each long body uses exactly 12,000 serialized units, including coverage and indentation. The synthetic case retains 11,322 source units and explicitly omits 49,319. Its ranges are [0,4748), [6166,7562), [14235,15630), and [19562,23345): the late heading and complete inert trace survive verbatim. Editing the omitted final unit leaves displayed text unchanged while changing full-source hash, source revision, snapshot, content, and structural identities.

Supplemental excerpts cause zero media runner calls. Three patch-only fixture cases, passed through production collection and media preparation, also cause zero calls, no manifest, and no artifacts, while retaining their compact patches in final prompt JSON. Each identical URL still produces one recording-only call when supplied by a primary issue body, PR body, or comment. These controls demonstrate source exclusion, not URL blacklisting.

The same committed producer replayed the authorized saved 60,641-unit original body as text. Its retained trace [19562,23034) contains the recorded HTTP status 202, SqlStorage, and row count 5, verified against source bytes and excerpt hashes. It retains 10,979 units and explicitly omits 49,662 within the same 12,000-unit allocation. The original body/bootstrap/trace is not copied into this PR, and its original runtime proof was not rerun.

Reproducible artifacts: Producer script and historical proof recipe. The stdout receipt includes current HEAD, environment, source/prompt hashes, ranges/excerpt hashes, omissions, before/after identities, and media counts. Optional local --body-file replay emits no source text or private file path.

Limits: This proves producer input delivery and omission—not live GitHub integration, source authenticity, proof sufficiency, the original Worker/DO behavior, or a guaranteed model verdict. No model, cloud service, embedded script, or remote/loopback media I/O is invoked. Producer-side context loss is established, not sole causation of any particular verdict. Crowded, oversized, or unrecognized layouts can still omit material; coverage remains explicitly incomplete.

Finding Disposition

The first exact-head review run, on d68b5ef6c130, rated the producer proof sufficient but raised two P1 fixture-URL findings before its live-proof inspection failed. Both reported sites are addressed as one media-source boundary defect:

  • Compact PR patches are now excluded from automatic media discovery, while remaining unchanged in reviewer context. Body/comment media continues to work even when the same URL also appears in a patch.
  • All introduced media fixtures use obvious string parts joined at runtime, protecting the existing predeployment reviewer without changing runtime assertion values. This complements, rather than replaces, the production exclusion.
  • Offline reproduction of the original aggregate patch recorded two would-be calls from the test patch. The producer-script literals were outside the existing 2,000-unit compact-patch window and were not independently reachable there; they were corrected as well. The corrected aggregate diff produces zero calls under both the fixed and predeployment owners, and contains no downloadable fixture literals.
  • Three new regression cases failed before the owner correction and passed afterward. Current committed-head producer receipts were regenerated, and a fresh review is requested only after this body and the branch are current. Both applicable rank-up moves from the first review are implemented.

Why This Change Was Made

Primary bodies share their existing allocation between an opening, at most three source-ordered proof/output excerpts, and host-generated coverage with full-source identity and exact ranges. Reviewer guidance treats omissions as unknown context rather than absent/mock-only proof. Excerpts remain untrusted text; neither supplemental excerpts nor PR patches authorize automatic media downloads.

There is no body-budget increase, weakened proof requirement, proof-status/schema enum change, or new mutation authority. Related bodies, comments, patch content, local overrides, and freshness/cache owners retain their contracts. Current main's cold-checkout prerequisites and terminal-completion behavior are preserved; unrelated live-proof parsing is not changed here.

User Impact

Reviewers receive useful late evidence and an explicit account of omissions, without pretending the full body was read. Code/test fixture links in PR patches no longer become automatic media-download requests.

OpenClaw Bay Impact

Bay is unaffected: no observer fields, routes, lifecycle states, public data contracts, or controls change.

Documentation Impact

Updated the active contract in docs/pr-review-comments.md, the historical producer-proof recipe, and the existing changelog entry. Reviewed CONTRIBUTING, the documentation index, and live-proof guidance; runtime execution and publication ownership remain unchanged.

Evidence

The corrected build, 273 focused tests, touched-file lint/format, docs checks, and git diff --check passed. Fresh local Codex autoreview reported no P0 findings. Synthetic and saved-body producer receipts are bound to the current committed head above.

All PR checks, including full repository CI, passed at the prior head. Earlier local full checks exposed inherited coverage-collection and 250 ms timing-fixture flakes; these are recorded rather than hidden or worked around in this patch. The updated head's required CI and current-head/body ClawSweeper review remain landing gates. No proof override, live queue/workflow change, or gate bypass is requested.

Share a 12000-unit body allocation with explicit unknown-context coverage. Preserve full-source freshness without supplemental automatic media fetches.
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. proof: sufficient Contributor real behavior proof is sufficient. 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 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 8:35 PM ET / August 28, 2026, 00:35 UTC.

ClawSweeper review

What this changes

The PR preserves bounded late proof and trace excerpts from long primary item bodies while excluding PR patches and supplemental excerpts from automatic media retrieval.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open: it remains necessary because current main still truncates primary bodies at the opening budget and includes PR patch text in media URL discovery. The exact-head patch addresses both boundaries with focused regression coverage; no remaining code defect was identified.

Priority: P1
Reviewed head: e511af1c41f10b6b3837c709e2f1e3c81ae97f93

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered correction with credible exact-head behavior evidence; refreshed current-base validation remains the material landing check.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body supplies exact-head terminal-receipt evidence for the production hydration, compaction, prompt-rendering, and media-owner path, including the observed corrected outcomes and limits.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body supplies exact-head terminal-receipt evidence for the production hydration, compaction, prompt-rendering, and media-owner path, including the observed corrected outcomes and limits.
Evidence reviewed 5 items Current-main behavior remains affected: Current main still uses the generic 12,000-character truncation for the primary issue body, so late body evidence is not retained as separate covered excerpts.
Current-main media boundary: Current main serializes the review context without excluding pull-file patches or body coverage, allowing media-like URLs in those inputs to reach automatic discovery.
Introduced implementation and coverage: The PR adds bounded UTF-16-safe compaction with explicit source identity and omitted-range coverage, then tests late trace retention, cache invalidation, prompt rendering, and patch/excerpt media exclusion.
Findings None None.
Security None None.

Live Verification

Command: pnpm run build && node scripts/e2e/proof-context.ts

Result: PASS (completed)

          "runnerCalls": 1
        }
      ]
    },
    {
      "kind": "pull_request",
      "fixture": "existingPrefix",
      "patchOnlyRunnerCalls": 0,
      "patchesPreservedInPrompt": true,
      "controls": [
        {
          "source": "issue",
          "runnerCalls": 1
        },
        {
          "source": "pullRequest",
          "runnerCalls": 1
        },
        {
          "source": "comment",
          "runnerCalls": 1
        }
      ]
    },
    {
      "kind": "pull_request",
      "fixture": "prefix",
      "patchOnlyRunnerCalls": 0,
      "patchesPreservedInPrompt": true,
      "controls": [
        {
          "source": "issue",
          "runnerCalls": 1
        },
        {
          "source": "pullRequest",
          "runnerCalls": 1
        },
        {
          "source": "comment",
          "runnerCalls": 1
        }
      ]
    }
  ],
  "limits": "Producer input delivery and omission only, using local GitHub transport and the real compactor, renderer, and media owner. Recording-only media run
ner: no remote or loopback I/O. No model, live GitHub, cloud, embedded-script execution, or original runtime proof. Excerpts do not establish authenticity, suff
iciency, or a guaranteed verdict. No Bay changes."
}

Assertions:

  • PASS expect_output: "passed": true
  • PASS expect_output: "supplementalRunnerCalls": 0

How this fits together

ClawSweeper hydrates GitHub issue and PR records into bounded review context for Codex and media-proof preparation. This change retains selected late evidence for reviewers while keeping untrusted diff text out of automated downloads.

flowchart LR
A[GitHub item body] --> B[Context hydration]
B --> C[Primary body compaction]
C --> D[Review prompt]
B --> E[Media URL discovery]
E --> F[Proof artifacts]
D --> G[Codex review]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied test-merge artifact is stale: its first parent is fetched main rather than the pinned PR base, so landing should rely on a refreshed current-base merge/check result rather than that artifact.
  • Complete next step (P2) - No mechanical repair is needed; wait for refreshed current-base merge validation and the running exact-head checks.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Runtime versus test delta runtime +126, tests +697 The focused runtime boundary is accompanied by substantially broader regression coverage.
Changed surface 18 files, +1,169 / -5 Most of the change is coverage, proof documentation, and a producer harness around a small runtime boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the bounded-compaction and media-source boundary, then refresh merge validation against current main before landing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the bounded-compaction and media-source boundary, then refresh merge validation against current main before landing.

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

Yes. Current main’s truncation and media-discovery source, plus the deterministic long-body fixture at a late trace offset, provide a high-confidence source reproduction path; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The patch changes the primary-body boundary rather than broadening the body budget, and it excludes untrusted patches and supplemental excerpts while preserving primary body/comment media discovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6230a9d7c8b4.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body supplies exact-head terminal-receipt evidence for the production hydration, compaction, prompt-rendering, and media-owner path, including the observed corrected outcomes and limits.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: The PR repairs review evidence retention and removes untrusted PR-patch input from automatic media downloading.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body supplies exact-head terminal-receipt evidence for the production hydration, compaction, prompt-rendering, and media-owner path, including the observed corrected outcomes and limits.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies exact-head terminal-receipt evidence for the production hydration, compaction, prompt-rendering, and media-owner path, including the observed corrected outcomes and limits.

Evidence

What I checked:

  • Current-main behavior remains affected: Current main still uses the generic 12,000-character truncation for the primary issue body, so late body evidence is not retained as separate covered excerpts. (src/clawsweeper-item-context.ts:212, 6230a9d7c8b4)
  • Current-main media boundary: Current main serializes the review context without excluding pull-file patches or body coverage, allowing media-like URLs in those inputs to reach automatic discovery. (src/clawsweeper-media-proof.ts:43, 6230a9d7c8b4)
  • Introduced implementation and coverage: The PR adds bounded UTF-16-safe compaction with explicit source identity and omitted-range coverage, then tests late trace retention, cache invalidation, prompt rendering, and patch/excerpt media exclusion. (src/clawsweeper-primary-body.ts:35, e511af1c41f1)
  • Feature-history routing: The surrounding item-context and media-proof work is repeatedly authored by Peter Steinberger, including the prior hydration-snapshot and live-proof changes on the current-main lineage. (src/clawsweeper-item-context.ts:212, c9eda83c29d2)
  • After-fix behavior proof: The PR body reports an exact-head producer receipt exercising real hydration, compaction, review-prompt rendering, and the media owner with a long fixture; it records retained late trace ranges, freshness invalidation, and zero runner calls for patches and supplemental excerpts. (scripts/e2e/proof-context.ts:29, e511af1c41f1)

Likely related people:

  • steipete: Peter Steinberger authored the current PR and the prior current-main hydration and media-proof work in this subsystem. (role: recent area contributor; confidence: high; commits: c9eda83c29d2, c06a897aadd7, e511af1c41f1; files: src/clawsweeper-item-context.ts, src/clawsweeper-media-proof.ts)

Rank-up moves

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

  • Refresh the merge/check result against current main before landing.

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-27T23:56:12.913Z sha d68b5ef :: needs changes before merge. :: [P1] Keep the loopback fixture URL out of the PR patch | [P1] Remove the raw URL from the producer-script diff

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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 status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 28, 2026
@steipete
steipete merged commit 78540e0 into main Aug 28, 2026
20 checks passed
@steipete
steipete deleted the steipete/proof-context-20260827 branch August 28, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Urgent regression or broken agent/channel workflow affecting real users now. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant