Skip to content

fix(security): install and attest the source-pinned Bash parser - #4108

Merged
Patrick-Erichsen merged 2 commits into
mainfrom
adopt-bash-source-ownership
Oct 28, 2026
Merged

Patrick-Erichsen merged 2 commits into
mainfrom
adopt-bash-source-ownership

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Host scanner installs now build and attest the source-pinned Bash parser when the selected SkillSpector source requires it. Original diagnostic sources without the Bash module retain their existing installation path.

selected source → matching Bash module + immutable version → shfmt → adapter checks
legacy source  → existing adapters; parser metadata stays absent

Evidence

  • Before: modern host installs lacked the helper required for proven Bash source roles.
  • After: 11 installer controls cover modern/legacy sources, both adapter orders, exact version checks, invalid pins and Python PATH preservation. Diagnostic metadata records whether the helper is required, its version and SHA256.
  • Own frozen-dependency coverage: 8,233 passed, 3 skipped. Static, TypeScript, app build and package gates pass. Independent P0–P3 reviews are clean.
  • Repair the inherited CI-only receipt ZIP timestamp flake without changing production authorization: two clock-advance recovery controls fail before the fixture fix; all 39 authorization controls pass afterward. The full-tested tree equals the published tree, with 48 final focused installer/authorization controls passing.
  • A fresh real host install at ClawScan 3df9345 passed 69 Responses and 33 Bash controls, then exposed a macOS startup assumption in the upstream helper-timeout test. A separate test-only repair passes all 34 Bash controls and five repeated timeout controls. Production parser limits are unchanged.

Merge Danger

Door: two-way

Blast Radius: installation

This support change leaves the scanner source pin unchanged. Runtime activation and original-publication recovery require separate qualification.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clawhub Ready Ready Preview Oct 28, 2026 5:46am UTC

Request Review

@clawsweeper

clawsweeper Bot commented Oct 28, 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 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 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR installs the Bash parser required by selected SkillSpector sources and records its version and hash in diagnostic attestations.

Example: Install SkillSpector from ClawScan revision 3df93451eb5b7f4e28e9f2f6d496fe6416507bf0.

  • Before: The host installer omits shfmt, leaving canonical Bash parsing unavailable.
  • After: The installer builds shfmt v3.14.1, verifies its version, exposes it on PATH, and runs the upstream Bash controls.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, narrowly scoped repair with source-consistent dependency handling and limited validation confidence.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate is exempt for this collaborator-authored PR. The body reports a real macOS host install and discloses its upstream test failure, but supplies no inspectable terminal artifact for the completed install or new attestation fields; the added installer controls substitute external tools.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Host scanners using the newer reviewed Bash implementation cannot use its canonical parser unless the matching helper is installed.
Reason: The collaborator-authored direction supplies a bounded dependency prerequisite while preserving legacy sources, scanner policy and the production activation boundary.

Merge readiness

✅ Ready for maintainer review

Keep open: this collaborator-authored PR supplies useful installer support absent from main. No definite introduced correctness or security defect was found; runtime activation remains separate.

Priority: P2
Reviewed head: 11516a97355cc26b41d2d0e25d3512592471a35e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied material does not attach a completed shipped-installer trace covering parser installation and diagnostic attestation, or demonstrate the regression tests failing on base and passing on head.
Agent review details

How this fits together

Security workers and original-input diagnostics use the shared installer to turn reviewed ClawScan source pins into host scanner executables; diagnostics additionally emit runtime attestations.

flowchart TD
  A[Reviewed ClawScan source] --> B[Shared scanner installer]
  B --> C[Patched SkillSpector source]
  B --> D[Pinned shfmt executable]
  C --> E[Adapter and Bash controls]
  D --> E
  E --> F[Worker scanner runtime]
  F --> G[Diagnostic attestation]
Loading

Technical review

Best possible solution:

Keep parser installation in the shared installer, derive its version from reviewed ClawScan source, and qualify source-pin activation separately.

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

Source inspection establishes that selecting the modern ClawScan source introduces shell_source.py and a shfmt requirement that main's host installer does not satisfy; the currently selected production source predates that requirement.

Is this the best way to solve the issue?

This is the best repair location: the shared installer already owns matched host dependencies, while a workflow-specific install would duplicate policy and changing the production source pin would expand the scope.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 19aaf59306b6.

Provenance checked

  • Shared host scanner installation and PATH ownership keeps the original intent (21841f0: Install exact source-matched scanners and adapters through one shared owner while exposing scanner entrypoints without shadowing the selected Python.)
  • Selected Python and toolchain preservation keeps the original intent (07fa79f: Bind frozen dependency resolution to the workflow-selected patched interpreter rather than an ambient Python.)
  • Original-input diagnostic attestation keeps the original intent (d3932d0: Record bounded, nonpublishing evidence for fixed original inputs while retaining production budgets and source identity.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit d3932d0 adds scripts/security/clawscan-diagnostic-runtime.ts:86 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d3932d019920; files: scripts/security/clawscan-diagnostic-runtime.ts)

Review metrics

Metric Value Why it matters
Patch size Production +53/-1; tests +72/-8 across 3 files The change extends existing installer and attestation owners without adding modules or a parallel implementation.

Labels

Label changes:

  • add P2: Focused scanner installation support with limited immediate impact because the production source pin remains unchanged.
  • 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: Focused scanner installation support with limited immediate impact because the production source pin remains unchanged.
  • 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 28, 2026, 1:31 AM ET / 05:31 UTC.

@Patrick-Erichsen

Copy link
Copy Markdown
Collaborator Author

Final-head proof at 2f53fad35b1fe6087766b867837d75ddf2f716b4:

A fresh real macOS arm64 host ran the shipped install-clawscan.sh and both shared scanner installer paths against the immutable merged companion source ba09e851ec10b57fc903da1f2223bd3a3d8c2f7e (including the separate helper-readiness repair). Actual output:

69 passed in 10.06s              # SkillSpector Responses adapters
34 passed in 1.94s               # actual Bash helper controls
All installed packages are compatible
skillspector source: 95a52d89fa16f608f0b18ccee76b0918ea4b7eef
259 passed in 67.53s             # AIG adapters
All installed packages are compatible
aig source: a5c5a72c2e5b88fc6e5b27e0c86110943c4d350b
shfmt --version: v3.14.1

Actual helper SHA256: 6efb5eff201c67595b4a088a28cdb1f3ad96210ec376d73a7ad056db5b0ec585; reconstructed uv.lock SHA256: b8d19c16020091af248ec1566d6666de4cf408e4dca193f0c9ead67072da785e. The scanner bin directory contains no Python shim. Real installation and every upstream adapter control completed successfully. The subsequent receipt-only source-directory calculation was corrected from .venv to its parent; no installer retry or production mutation was needed. New diagnostic parser metadata itself is covered by the focused subprocess/runtime controls, not claimed as a production attestation here. The original macOS timeout-test failure remains disclosed above and is fixed by ClawScan #120.

The final commit also fixes the CI-discovered test ZIP clock dependency: advancing mocked time by2s reproduces receipt-digest failures in both original submission and terminal controls before the change (2failed); pinning only test ZIP metadata makes all39 authorization controls pass. Production authorization and exact-digest assertions are unchanged. Final full own-dependency coverage:8,233pass/3skipped; focused installer/runtime/receipt controls48pass. Static/types/build/packages and schema/CLI TypeScript pass. Independent installer and fixture P0–P3 reviews are terminal clean.

This PR still does not change the production scanner source pin or retry any original.

@Patrick-Erichsen
Patrick-Erichsen merged commit 4bf5854 into main Oct 28, 2026
37 of 39 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the adopt-bash-source-ownership branch October 28, 2026 05:55

This branch was successfully deployed

1 active deployment
Preview – clawhub — 2f53fad3 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant