Skip to content

fix: line-cap checks skip files in ignored temporary directories - #151748

Merged
steipete merged 1 commit into
mainfrom
codex/fix-line-cap-snapshot-ignores-20260918
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-line-cap-snapshot-ignores-20260918

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Line-cap checks can report success without analyzing any files when the temporary directory is inside a Git-ignored directory such as .artifacts.

User Impact

The checker now measures copied source files in that environment and rejects actual over-cap growth. Explicit lint exclusions, configured caps and normal lint behavior remain unchanged. There is no runtime product change.

Why This Change Was Made

Oxlint inherits ancestor Git ignore rules while walking the disposable snapshots. An empty Git boundary inside the scratch directory stops that inheritance for both snapshots. The existing cleanup removes the boundary with the scratch directory.

This fixes the snapshot owner rather than relaxing lint configuration. The installed-tool reproduction also showed that --no-ignore alone still analyzed zero files in this case.

Evidence

  • The new regression failed on the original checker; all 16 owner tests pass with the repair.
  • The actual checker detects 5-to-6-line growth under an ignored repository-contained temporary directory, while preserving both ignorePatterns and override exclusions.
  • Raw oxlint probes analyzed zero files before the boundary and two afterward, with only the intended violation.
  • Formatting, script and root-test type graphs, both targeted lint scopes, line-cap, script erasability and diff checks passed. Independent Codex P2 review found no actionable issue.
  • Proof ran on macOS. Windows execution and the full local check suite were not run; hosted checks remain required before landing.

@clawsweeper

clawsweeper Bot commented Sep 18, 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 scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 11:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 7:47 AM ET / 11:47 UTC.

ClawSweeper review

What this changes

The PR prevents ancestor Git ignore rules from hiding temporary source snapshots from line-cap checks and adds regression coverage.

Merge readiness

✅ Ready for maintainer review

The repair remains useful on current main, and the introduced patch has no actionable correctness findings. The focused regression covers skipped measurement and preserved exclusions.

Priority: P2
Reviewed head: 515f5d5529d32daa3af2059451a2c27388cb8ac0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and a verified dependency contract.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer classification exempts this PR from the external-contributor proof gate. Its body reports exercising the actual checker and installed oxlint on macOS under ignored temporary storage, with growth rejected and exclusions preserved; those runs were not independently repeated.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer classification exempts this PR from the external-contributor proof gate. Its body reports exercising the actual checker and installed oxlint on macOS under ignored temporary storage, with growth rejected and exclusions preserved; those runs were not independently repeated.
Evidence reviewed 6 items Introduced repair: The pinned introduction delta creates a .git directory inside the existing disposable scratch directory before either snapshot is measured. Existing finally cleanup removes it with the scratch directory; configuration and source selection remain unchanged.
Behavioral regression coverage: The added test invokes the actual checker with temporary-directory variables pointing beneath an ignored .artifacts directory. It expects 5-to-6-line growth to fail, then verifies shrinking debt and both configuration exclusion forms still pass. Only console output and environment variables are mocked.
Current-main necessity: Fetched main still creates scratch snapshots without a Git boundary. The documented contract requires rejecting over-cap growth while preserving configured exclusions.
Findings None None.
Security None None.

How this fits together

The line-cap checker compares changed source files with their Git baseline using oxlint. Local checks and PR CI consume its result to reject new violations or growth in oversized files.

flowchart LR
  A[Changed source files] --> C[Disposable snapshots]
  B[Git baseline and lint configuration] --> C
  C --> D[Local Git-ignore boundary]
  D --> E[Oxlint line counts]
  E --> F[Compare allowed growth]
  F --> G[Pass or actionable failure]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +30, Other +2. Total +32 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 32 2 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 2 34 2 +32

Review metrics

None.

Technical review

Best possible solution:

Keep snapshot isolation in the existing checker while retaining configured caps, exclusions, and cleanup.

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

Yes, source establishes the trigger: place temporary snapshots beneath a Git-ignored directory and grow an oversized file. The regression encodes this path, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The boundary addresses oxlint's verified parent-ignore behavior at the snapshot owner without disabling explicit exclusions or changing repository lint policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8db38db91191.

Labels

Label changes:

  • add P2: A bounded tooling defect can silently bypass the documented line-cap growth check when temporary storage is Git-ignored.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer classification exempts this PR from the external-contributor proof gate. Its body reports exercising the actual checker and installed oxlint on macOS under ignored temporary storage, with growth rejected and exclusions preserved; those runs were not independently repeated.

Label justifications:

  • P2: A bounded tooling defect can silently bypass the documented line-cap growth check when temporary storage is Git-ignored.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer classification exempts this PR from the external-contributor proof gate. Its body reports exercising the actual checker and installed oxlint on macOS under ignored temporary storage, with growth rejected and exclusions preserved; those runs were not independently repeated.

Evidence

What I checked:

  • Introduced repair: The pinned introduction delta creates a .git directory inside the existing disposable scratch directory before either snapshot is measured. Existing finally cleanup removes it with the scratch directory; configuration and source selection remain unchanged. (scripts/check-line-cap-ratchet.mts:175, 515f5d5529d3)
  • Behavioral regression coverage: The added test invokes the actual checker with temporary-directory variables pointing beneath an ignored .artifacts directory. It expects 5-to-6-line growth to fail, then verifies shrinking debt and both configuration exclusion forms still pass. Only console output and environment variables are mocked. (test/scripts/check-line-cap-ratchet.test.ts:60, 515f5d5529d3)
  • Current-main necessity: Fetched main still creates scratch snapshots without a Git boundary. The documented contract requires rejecting over-cap growth while preserving configured exclusions. (scripts/check-line-cap-ratchet.mts:175, 8db38db91191)
  • Pinned dependency contract: OpenClaw pins oxlint 1.82.0 and collectViolations directly executes it, establishing the dependency signal. At that release, configure_walk_builder enables parent Git-ignore lookup with a repository boundary, and has_vcs_marker recognizes an existing .git entry. Dependency tests cover parent ignores stopping at that boundary. (crates/oxc_config/src/walk.rs:16, b4da00b621ec)
  • Feature-history routing: Current-main history includes c1f00ed and later maintenance in 2a5bb45. GitHub verifies fix(ci): reject line-cap growth on pull requests #149622 as merged and associates its commit with steipete. Local follow/blame inspection encountered an unavailable historical blob; the GitHub commit patch supplied the corresponding historical source context. (scripts/check-line-cap-ratchet.mts, c1f00edb04c2)
  • Release and submitted validation: The supplied latest-release commit has no scripts/check-line-cap-ratchet.mts entry, so that release does not contain this repair. The captured PR body reports a macOS installed-tool reproduction, zero files before versus two afterward, and 16 passing owner tests; Windows execution was explicitly unrun. This review executed no target code. (scripts/check-line-cap-ratchet.mts, 3a9d69db306c)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit a20d73a into main Sep 18, 2026
134 checks passed
@steipete
steipete deleted the codex/fix-line-cap-snapshot-ignores-20260918 branch September 18, 2026 11:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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