Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix(sdk): stop honeypot glob patterns with spaces over-matching

closed
#183 opened by detail-app[bot]detail/bug-fix/fix-sdk-stop-honeypot-glob-patterns-with-spaces-ov-08263a→main
Conversation5
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

What was wrong

globMatch in packages/sdk/src/glob.ts used a literal space (" ") as the temporary placeholder for ** while building its regex. The final .replaceAll(" ", ".*") then converted every literal space in a user-configured pattern into the wildcard .*, which also spans /. A maintainer pattern like docs/My Folder/** compiled to ^docs/My.*Folder/.*$, matching unrelated paths such as docs/MyXFolder/secret.yml — blocking legitimate change requests that never touched the honey pot and reporting wrong touched evidence.

The over-match was strictly fail-closed: a genuine honeypot touch was never missed (the wildcard is a superset of the literal space), but it caused false blocks on unrelated PRs.

This was a regression introduced in 2459c9d0 when the matcher moved into the SDK; the original honeypot matcher used a raw NUL byte as the placeholder, which cannot collide with user input.

Closes #170

What I changed

Swapped the ** sentinel from a literal space to a NUL byte (\u0000), which cannot appear in user-supplied config strings or paths. The transform chain is now ** → \u0000 → .*, so literal spaces in patterns stay literal. This restores the original pre-regression design.

  • packages/sdk/src/glob.ts — the fix (one-line sentinel change)
  • packages/sdk/src/glob.test.ts — new test file covering the space regression, **/* semantics, regex escaping, anchoring, and honeypot real-world patterns
  • packages/core/src/rules/honeypot.test.ts — two tests verifying the honeypot rule's verdict and touched evidence with space-containing patterns through the real evaluate path

What I decided

Restored the NUL byte rather than splitting on ** and joining with .*: the NUL approach is the proven, collision-free design the original implementation used, and the diff is minimal.

Testing

  • Reproduced the bug first: globMatch("docs/My Folder/**", "docs/MyXFolder/secret.yml") returned true before the fix, false after.
  • Unit tests: 27 new tests in glob.test.ts and 2 new tests in honeypot.test.ts — all pass.
  • Full suite: bun test (3923 tests across 328 files), bun run typecheck (all 15 packages), bun run check (Biome, 1297 files), and bun run check:boundaries all pass.
  • The live e2e harness (scripts/e2e/harness.ts) could not be run: it drives real GitHub pull requests via the gh CLI, and the available token is invalid (HTTP 401) with no valid GitHub App credentials in the environment to mint a fresh one. The in-process honeypot rule tests verify the same guarantees — verdict correctness and touched evidence for space-containing patterns — through the real rule engine without requiring a live GitHub connection.

Automatic Fixes PRs can be configured here.

unkey-deploy[bot]commented· 2 weeks ago

The latest updates on your projects. Learn more about Unkey Deploy

NameStatusPreviewInspectUpdated (UTC)
tripwire / web (preview)ReadyVisit PreviewInspectNov 7, 2026 6:54am

Changes requested

tripwire-sh[bot] · 2 weeks ago

Blocked. See the comment.

tripwire-sh[bot]commented· 2 weeks ago

@detail-app[bot], Tripwire blocked this change request.

Rate limit: You opened 57 change requests in a short time. Wait before you open another.

View on Tripwire

How do I fix this?

A new commit will not fix this.

If you think it should merge anyway, say so in a comment. A maintainer will decide.

capy-ai[bot]commented· 2 weeks ago

Capy couldn't review this pull request because grim's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.

Open in Capy

detail-app[bot]commented· 2 weeks ago

Re: github.com/Boring-Software-Inc/…/183 — Tripwire blocked this PR on a rate limit (57 change requests opened in a short time), not a code issue. Tripwire states a new commit will not fix it and that a maintainer must decide whether to override. No PR-side change can resolve this, so I'm not pushing.

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.