Skip to content

fix: unblock reviews rejected by raw Git metadata - #1659

Merged
steipete merged 1 commit into
mainfrom
codex/raw-diff-metadata-admission
Sep 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/raw-diff-metadata-admission

Conversation

@steipete

@steipete steipete commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes automated reviews being rejected when native credential detection mistakes a Git blob ID in a raw diff for a Cloudflare credential, as observed on openclaw/openclaw#156363.

User Impact

Reviews can proceed after the existing metadata owner proves that the finding is generated Git metadata. Original source, prompts, schemas, and additional inputs remain fully scanned. No detector, verification flag, workflow gate, or fixture allowlist is disabled.

Why This Change Was Made

The existing qualification covered patch headers but not the raw diff that describes the same objects. It now requires canonical matching raw and patch records, independently hashed present blobs, proven absent endpoints for added/deleted files, and no path/content collisions. A mandatory native replay masks only proven object-ID fields; any remaining raw-diff finding or incomplete replay still refuses admission.

OpenClaw Bay Impact

None. Public status, queue, publication, dashboard contracts, and action surfaces are unchanged.

Documentation Impact

Updated the active README contract and metadata-proof runbook, owned by the input-scanner implementation and verified against this candidate with pinned TruffleHog 3.97.4. Added a reproducible native raw-diff proof driver. Revalidate the guide when scanner pin, metadata witness rules, or input staging changes. Changelog updated under Unreleased.

Real Behavior Proof

Claim and surface: the real input-scan owner admits proven raw Git metadata only after a successful supplemental native scan, while matching content remains rejected.

Fixture and environment: one committed synthetic Git repository with a moved regular file and versioned filenames, exercised through pristine baseline 60a77566 and the candidate. macOS arm64, Node 26.9.0, checksum-pinned TruffleHog 3.97.4, verification enabled with unchanged flags.

Reproduce: build the candidate and a trusted baseline checkout, then run:

pnpm run build:node
node docs/proof/agent-input-scan-git-metadata/run-raw-diff-proof.mjs /tmp/raw-diff-proof.json /path/to/built-baseline

Observed trace: baseline refused detector 58 in raw_diff; candidate admitted after classifying an actual native raw-diff finding and replaying the masked input. Literal, HTML tag-split, and HTML-entity copies in additional input all refused. Five scenarios completed in about 10.8 seconds. The generated JSON records source identities, counts, notices and refusal classifications without matched values.

Limits: this is controlled real scanner execution, not a model run or a replay of the full hosted review. The hosted safe diagnostic omits matched digests, so exact identity of its 25 findings cannot be recovered. Its detector/material/decoder shape matches the reproduced path. Hosted reviews still scan their own complete inputs.

Evidence

  • 25 focused metadata-owner cases pass in 17.16 seconds, covering malformed/duplicate records, missing or false endpoints, altered modes, content/path collisions, verified/residual findings, incomplete completion, and scanner errors.
  • Existing seven-scenario native metadata proof passes, including encoded-content refusal controls.
  • Full pnpm check: 6,547 passed, 36 skipped, two failures in 21m23s. Both failures reproduce unchanged on pristine baseline: the macOS run selected Bash 3.2 without mapfile, and the Swedish-locale action-ledger process-incarnation probe failed. The apply-drift file then passed with the documented supported Bash (1 case, 18.95 seconds), resolving that prerequisite without source changes. The locale failure remains baseline-reproduced. Scanner tests, static checks, all builds, lint, and changed coverage pass.
  • Independent Codex reviews of both the final working tree and committed branch 0b688d6309ecf871fd142cface143b879b7688e8 against 60a77566 are scoped-clean through P2. Hosted CI remains required before landing.
  • A review concern about cross-file deduplication was checked against pinned native source and real cross-input probes: the key includes SourceMetadata, including the filesystem input path, and encoded additional-input findings remain rejected. No policy relaxation was made.

@clawsweeper

clawsweeper Bot commented Sep 23, 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 P2 Normal priority bug or improvement with limited blast radius. 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. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 9:26 AM ET / 13:26 UTC (Revision 2).

ClawSweeper review

What this changes

Extends Git metadata qualification to raw diffs and added or deleted files, allowing reviews to proceed only after matching source checks and a successful supplemental scan.

Merge readiness

✅ Ready for maintainer review

This remains useful work: current main rejects the raw-diff findings addressed here. The reviewed patch preserves mandatory scanning and rejection controls, and no actionable correctness or security defect was found.

Priority: P2
Reviewed head: 0b688d6309ecf871fd142cface143b879b7688e8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extension with meaningful native admission and rejection proof, supporting regression coverage, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied macOS native trace exercises scanAgentInput with pinned TruffleHog: baseline refusal becomes candidate admission after raw-diff replay, while literal and encoded content controls remain refused. The inspected driver binds those observations to the changed path; no persistent data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The supplied macOS native trace exercises scanAgentInput with pinned TruffleHog: baseline refusal becomes candidate admission after raw-diff replay, while literal and encoded content controls remain refused. The inspected driver binds those observations to the changed path; no persistent data contract changes.
Evidence reviewed 8 items Policy and scope: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was found. Applied conservative scanner review, proof, and Bay-boundary guidance. The body explicitly explains why Bay is unaffected.
Current main still needs this change: The baseline metadata resolver accepts only patch material and modified-file records. GitHub's main endpoint still resolves to the supplied baseline; the latest release remains v0.3.0. The merged earlier implementation at #1601 does not cover this raw-diff admission path.
Introduced safeguards: The pinned delta requires canonical raw/patch agreement, independently hashed present blobs, absent-endpoint checks, unique records, and rejection of matching content or paths. No dependency, workflow permission, scanner flag, or fixture allowlist changes were introduced.
Findings None None.
Security None None.

How this fits together

ClawSweeper scans review prompts, schemas, diffs, and source blobs before starting an agent. This change distinguishes generated Git object IDs from credential findings while preserving rejection of sensitive input.

flowchart TD
  A[Prompts and source material] --> B[Primary credential scan]
  B --> C[Git metadata witnesses]
  C --> D[Masked metadata replay]
  D --> E{Complete and clean?}
  E -->|Yes| F[Final source checks and agent admission]
  E -->|No| G[Refuse review]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +107/-33 (net +74); tests +227/-71 (net +156) Production growth extends the existing witness and replay owner; regression coverage exercises admission and refusal.
Native proof scenarios 5 scenarios: baseline refusal, candidate admission, 3 rejection controls The supplied proof exercises the changed production boundary with the pinned scanner.

Technical review

Best possible solution:

Keep one shared metadata-witness owner and require complete native replay before admitting generated Git metadata.

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

Yes: current-main source rejects this raw-diff finding shape, and the supplied native baseline/candidate trace demonstrates the controlled case; this reviewer did not execute it.

Is this the best way to solve the issue?

Yes: extending the existing witness and replay mechanism avoids a parallel allowlist and preserves complete primary scanning.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs bounded false-positive review refusals while retaining the credential-scanning gate.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The supplied macOS native trace exercises scanAgentInput with pinned TruffleHog: baseline refusal becomes candidate admission after raw-diff replay, while literal and encoded content controls remain refused. The inspected driver binds those observations to the changed path; no persistent data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied macOS native trace exercises scanAgentInput with pinned TruffleHog: baseline refusal becomes candidate admission after raw-diff replay, while literal and encoded content controls remain refused. The inspected driver binds those observations to the changed path; no persistent data contract changes.

Evidence

What I checked:

  • Policy and scope: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was found. Applied conservative scanner review, proof, and Bay-boundary guidance. The body explicitly explains why Bay is unaffected. (AGENTS.md:90, 0b688d6309ec)
  • Current main still needs this change: The baseline metadata resolver accepts only patch material and modified-file records. GitHub's main endpoint still resolves to the supplied baseline; the latest release remains v0.3.0. The merged earlier implementation at fix(scanner): unblock reviews of generated Git metadata #1601 does not cover this raw-diff admission path. (src/agent-input-scan-git-metadata.ts:45, 60a77566c685)
  • Introduced safeguards: The pinned delta requires canonical raw/patch agreement, independently hashed present blobs, absent-endpoint checks, unique records, and rejection of matching content or paths. No dependency, workflow permission, scanner flag, or fixture allowlist changes were introduced. (src/agent-input-scan-git-metadata.ts:41, 0b688d6309ec)
  • Replay cannot authorize residual raw findings: Raw replay uses a distinct material kind without fixture admission. Confirmation must complete and classify successfully; source fences and cleanup precede success. The agent runner calls this owner before starting the agent process. (src/agent-input-scan.ts:709, 0b688d6309ec)
  • Controlled native behavior proof: The captured PR body and committed runbook report five real scan scenarios on macOS arm64, Node 26.9.0, and pinned TruffleHog 3.97.4: baseline raw-diff refusal, candidate admission after replay, and refusal of literal, tag-split, and entity-encoded additional input. The inspected driver requires an actual raw-diff finding. This demonstrates the production scan owner, not a model run; exact identities from the original hosted incident remain unavailable. No code or proof script was executed during this read-only review. (docs/proof/agent-input-scan-git-metadata/README.md:28, 0b688d6309ec)
  • Dependency contract independently checked: The PR's cross-input safety claim explicitly depends on TruffleHog deduplication. At v3.97.4, the result key includes SourceMetadata, and the filesystem source records each input path there, supporting the reported encoded-input rejection controls. (pkg/engine/engine.go:1339, 363923b901c9)

Likely related people:

  • Peter Steinberger: Raw commit f48f1ce adds src/agent-input-scan-git-metadata.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f48f1cee58c5; files: src/agent-input-scan-git-metadata.ts)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-23T13:20:12.921Z sha 0b688d6 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 23, 2026 13:21
@steipete
steipete merged commit 74df933 into main Sep 23, 2026
28 checks passed
@steipete
steipete deleted the codex/raw-diff-metadata-admission branch September 23, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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