Skip to content

refactor: consolidate scanner evidence checks and judge input handling - #184

Merged
vincentkoc merged 3 commits into
mainfrom
refactor/reviewed-function-duplicates
Nov 20, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
refactor/reviewed-function-duplicates

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

Maintaining the evidence passed from a scan to a judge required updating duplicate report checks, prompt builders, and trimming routines. This refactor gives each operation one implementation inside its current package or runtime and reuses the same fixture writers in the scanner tests.

Scope and trust impact

  • Keep the A.I.G evidence labels, raw SARIF bytes, and prompt ordering. Resolve nested SkillSpector fields once with the same fallback order.
  • Share finding and component validation for standalone and bundled SkillSpector reports. Regression cases cover their different rules for empty component lists.
  • Use one Decisions trimming routine for gap records and bundled children, retaining the existing stage order, floors, and omission accounting.
  • Public CLI, SDK, artifact, sandbox, and credential contracts are unchanged.

Verification

  • go test -count=1 ./... and go vet ./... passed.
  • go run ./cmd/clawscan --help passed.
  • python3 -m unittest discover -s docker/clawscan-runtime/tests -p test_decisions_judge.py -q passed all 24 tests.
  • Compared the original and updated Decisions trimmers across 574 combinations of evidence shape and value budget. The resulting evidence and errors matched, including ties and fully exhausted lists.
  • Repository autoreview reported no actionable findings through P3.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@vincentkoc
vincentkoc marked this pull request as ready for review November 20, 2026 09:30
@vincentkoc
vincentkoc requested review from a team and Patrick-Erichsen as code owners November 20, 2026 09:30
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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:feature Preliminary submission classification; full source review pending. labels Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates scanner evidence validation, prompt assembly, Decisions input trimming, and test fixture helpers.

Example: A standalone partial SkillSpector report contains components: [].

  • Before: The report is rejected because standalone partial evidence requires a nonempty component list.
  • After: The same rejection remains, while bundled complete children still permit an empty optional component list.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source supports a focused, behavior-preserving consolidation; validation confidence remains limited by the unclassified production-contract failure.
Proof confidence 🦐 gold shrimp (3/6) This internal refactor changes no intended user-visible behavior; the body reports Go validation, Python tests, and a trimmer equivalence comparison, which were assessed without executing target code.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction reduces maintenance duplication while retaining the existing scanner and judge contracts.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it removes meaningful duplication, preserves the reviewed contracts, and has no actionable code findings.

Priority: P3
Reviewed head: 3b382df8f8b77e10e342585f24b0ef25bc401790

Before merge

None.

Findings

None.

Agent review details

How this fits together

Scanner reports enter the Go runner as raw JSON, pass evidence checks, and feed judge prompts; the Python Decisions judge bounds its assembled input before submission.

flowchart LR
A[Scanner reports] --> B[Runner evidence validation]
B --> C[Raw run artifacts]
B --> D[Judge prompt assembly]
D --> E[Decisions evidence trimming]
E --> F[External judge]
Loading

Technical review

Best possible solution:

Retain the consolidation and resolve attribution of the production-contract check before landing.

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

No bug reproduction is claimed; review compared introduced hunks with their original implementations without running target code.

Is this the best way to solve the issue?

The shared helpers stay within existing owners and remove duplication without adding configuration, changing fallback order, or weakening validation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • SkillSpector standalone and bundled validation keeps the original intent (a5301cc: Allow usable partial evidence to reach independent judges while rejecting malformed, unsuccessful, fatal, or ambiguous reports.)
  • ClawHub parity normalization and AIG prompt evidence keeps the original intent (d9dc56a: Match production prompt behavior; subsequent AIG additions attach raw SARIF based on scanner-result presence.)
  • Decisions evidence trimming and final-limit assertions keeps the original intent (22d2f69: Keep judge-specific input limits within the Decisions command and preserve truthful omission accounting.)
  • Scanner and CLI test fixtures keeps the original intent (4b8364c: Exercise adapter report-file handling and preserve upstream evidence; the consolidated fixtures retain flags, file contents, permissions, errors, and recorded calls.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit 7343e0e adds internal/runner/runner.go:1080 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7343e0e013a7; files: internal/runner/runner.go)

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
Code reduction Production +59/-115; tests +44/-90 The reduction removes duplicate implementations while preserving the reviewed behavior.

Labels

Label changes:

  • add P3: This is internal maintenance with no demonstrated user-facing behavior change.
  • 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:

  • P3: This is internal maintenance with no demonstrated user-facing behavior change.
  • 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.

Rank-up moves

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

  • Have the CI owner inspect the production-contract failure and determine whether it is related to this diff.

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 20, 2026, 4:44 AM ET / 09:44 UTC.

…/reviewed-function-duplicates

* commit '3ae7dde30ffcd355b85f4f1f5f1eb2b275fd502c':
  ci: limit macOS packaging checks to Darwin binaries (#173)
  test(cli): drain both output streams during CLI tests (#167)
  fix(ci): share the JSON file writer with submission scoring (#186)
  test(runner): synchronize cancellation with scanner progress (#179)
  refactor(runner): share Cisco and AIG report file handling (#183)
  test(runner): share stdout scanner contract cases (#178)
  refactor(runner): build SkillSpector evidence results once (#172)
  refactor(profiles): share YAML field definitions for scanners and mounts (#171)
  ci: skip the Go cache when submissions are unchanged (#175)
  ci: reuse each submission score for its summary (#174)
  refactor(profiles): resolve scanner and judge options in one place (#168)
  refactor(runner): remove unused benchmark and workspace entry points (#166)
  refactor(leaderboard): reuse the Space scoring and JSONL helpers (#163)
  build(deps): update golang.org/x/text to v0.44.0 (#162)
  refactor(runner): share JSON output handling across four scanners (#164)
  refactor(cli): keep benchmark execution in its subcommand (#161)
  refactor(benchmark): remove the retired README metrics writer (#160)
@vincentkoc
vincentkoc merged commit 37e23ad into main Nov 20, 2026
14 checks passed
@vincentkoc
vincentkoc deleted the refactor/reviewed-function-duplicates branch November 20, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant