Skip to content

fix(pentest): address cubic review findings on finding-context flow#3112

Merged
tofikwest merged 1 commit into
mainfrom
tofik/pentest-context-review-fixes
Jun 11, 2026
Merged

fix(pentest): address cubic review findings on finding-context flow#3112
tofikwest merged 1 commit into
mainfrom
tofik/pentest-context-review-fixes

Conversation

@tofikwest

@tofikwest tofikwest commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes the three findings cubic raised on the production deploy PR (#3111) against the pentest finding-context feature (#3110).

  1. Best-effort notes lookup in createReport — the finding-context query now goes through the same quiet helper the report appendix uses: a DB failure (transient outage, or the table missing mid-deploy before the migration applies) logs and proceeds with the caller's own context instead of blocking pentest creation. Regression test: notes query rejects → run is still created, user-typed context still reaches the provider.

  2. normalizeTargetUrl no longer corrupts query values — trailing slashes are stripped from the URL path only, so ?next=/portal/ keeps its value. Origin-only and path-only targets normalize exactly as before, so existing stored keys for the common cases are unaffected. Regression tests for both query cases.

  3. PDF appendix hard-wraps unbroken tokens — notes containing long URLs/IDs are now split at character level when a single token exceeds the line width, instead of overflowing the page margin. Test asserts every wrapped line fits the appendix body width and no characters are lost.

Module suite: 100 passing (4 new tests). Typecheck clean on all touched files.

🤖 Generated with Claude Code


Summary by cubic

Makes the pentest finding-context flow more robust and correct. Runs are no longer blocked by notes lookup failures, URL normalization preserves query values, and PDF notes no longer overflow.

  • Bug Fixes
    • Notes lookup during report creation is best-effort; on DB errors we log and proceed with the user’s context.
    • URL normalization trims trailing slashes from the path only, keeping query values intact (e.g., ?next=/portal/).
    • PDF appendix hard-wraps long unbroken tokens (URLs/IDs) to prevent line overflow.

Written for commit 9bf3bb1. Summary will update on new commits.

Review in cubic

- createReport notes lookup is now best-effort via the shared quiet
  helper: a DB failure (transient outage or table missing mid-deploy)
  logs and proceeds with the caller's own context instead of blocking
  pentest creation
- normalizeTargetUrl strips trailing slashes from the path only, so a
  '/' at the end of a query value is preserved instead of corrupting
  the finding-context key
- PDF appendix wrapper hard-breaks unbroken tokens (long URLs/IDs)
  that exceed the line width instead of overflowing the margin

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment Jun 11, 2026 11:55pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Jun 11, 2026 11:55pm
portal Skipped Skipped Jun 11, 2026 11:55pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit c3af014 into main Jun 11, 2026
11 checks passed
@tofikwest tofikwest deleted the tofik/pentest-context-review-fixes branch June 11, 2026 23:59
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.79.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants