Skip to content

PR title - #76

Open
dogancanbakir wants to merge 3 commits into
mainfrom
claude/issue-4-batch
Open

dogancanbakir wants to merge 3 commits into
mainfrom
claude/issue-4-batch

Conversation

@dogancanbakir

@dogancanbakir dogancanbakir commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

feat: add batch mode for multiple URLs via --list

PR body

Closes #4

What

Adds a --list flag to dit run to process a list of URLs from a file:

dit run --list urls.txt

The file holds one URL per line (blank lines and # comments are skipped). The model is loaded once, every URL is fetched and classified, and results are streamed to stdout as newline-delimited JSON — one object per URL:

{"url":"https://example.com/login","page":{"type":"login","forms":[...]}}
{"url":"https://bad.example","error":"fetch URL: ..."}

Fetch or classification errors are reported per URL in the stream without aborting the batch, so long runs survive individual failures. --proba, --render, --timeout, and --model all apply in batch mode. Combining --list with a positional argument is rejected.

Changes

  • internal/cli/run.go: new --list flag; runBatch (opens the list file, loads the model once, streams batchResult lines via json.Encoder); readURLList (line parsing with blank/comment skipping); classifyTarget (page classification with forms-only fallback, mirroring the single-target logic); help-text example.
  • internal/cli/run_test.go (new): unit tests for readURLList (comment/blank skipping, trimming, empty list).
  • README.md: documented batch mode.

The single-target code path is untouched, so existing behavior and output are unchanged.

Testing

  • go build ./... and go vet ./... pass.
  • go test ./...: all packages pass, including the new internal/cli unit tests; the only failures are the two pre-existing root-package functional tests that need to download the pretrained model from Hugging Face, which was blocked in my sandbox (they fail identically on main there).
  • Smoke-tested the built binary: --list with a positional arg, a missing list file, and a list with no URLs each produce clear errors; a valid list proceeds to model loading (blocked only by the sandbox network).

Process a list of URLs from a file:

    dit run --list urls.txt

Reads one URL per line (blank lines and "#" comments are skipped),
loads the model once, classifies every page, and streams one JSON
result per line to stdout. Fetch or classification errors are reported
per URL in the output stream without aborting the batch. Works with
--proba, --render, and --model.
Clears the repo-wide Govulncheck CI failure; identical to the bump in
the sibling PRs, merges cleanly in any order.

dogancanbakir commented Nov 1, 2026 •

Copy link
Copy Markdown
Member Author

@recepgunes1 fixed — the Govulncheck failure was repo-wide: CI installs the toolchain from go.mod, and go1.26.9 is affected by GO-2026-6809. This branch now carries the one-line go1.26.10 bump (standalone green; identical change in the sibling PRs and in the dedicated bump PR, merges cleanly in any order).

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4c368a3-9b3a-4062-b318-ed29f12cec78
Commits

Reviewing files that changed from the base of the PR and between b41c174 and 3b5c313.

Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
Files selected for processing: 4
  • README.md
  • go.mod
  • internal/cli/run.go
  • internal/cli/run_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@recepgunes1

Copy link
Copy Markdown
Member

@dogancanbakir ci fails pls check it

Same security bump as the dedicated fix PR; identical changes merge
cleanly in any order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch mode for multiple URLs

2 participants