feat(analyze): accept multiple keys in analyze subcommand#91
feat(analyze): accept multiple keys in analyze subcommand#91
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (3)**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/main.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (25)📓 Common learnings📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-02T14:18:44.316ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-02T14:18:44.316ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-13T13:20:58.369ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-05T12:40:29.177ZApplied to files:
📚 Learning: 2026-03-12T18:25:01.029ZApplied to files:
📚 Learning: 2026-03-12T18:24:52.371ZApplied to files:
📚 Learning: 2026-03-12T18:25:01.029ZApplied to files:
📚 Learning: 2026-03-22T18:38:29.431ZApplied to files:
📚 Learning: 2026-03-12T18:25:01.029ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
📚 Learning: 2026-03-02T14:18:08.405ZApplied to files:
🔇 Additional comments (7)
📝 WalkthroughWalkthroughThe analyze command now accepts multiple positional Changes
sequenceDiagram
participant CLI as Client
participant Main as Main\n(arg merge)
participant Parser as KeyParser\n(parse_private_key)
participant Engine as AnalyzerEngine\n(verify & run)
participant GPU as GPU\n(optional)
CLI->>Main: invoke `vuke analyze` (keys + optional key-file)
Main->>Main: read file lines, trim, filter, merge into Vec<String>
loop per key
Main->>Parser: parse key_input
alt parse OK
Parser->>Main: KeyMetadata
Main->>Engine: verify (optional) & run analyzers with metadata
Engine->>GPU: attempt GPU analyzers (if enabled)
GPU-->>Engine: results or fallback
Engine-->>Main: per-key results
Main->>CLI: emit per-key JSON object or text block
else parse FAIL
Parser-->>Main: parse error
Main->>CLI: emit per-key error (JSON or stderr)
end
end
alt multiple keys
Main->>CLI: emit aggregated JSON array or separated text sections
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: This change involves a significant refactor of the run_analyze function and modifies core subcommand logic to support multiple inputs and file I/O.
Architecture diagram
sequenceDiagram
participant User
participant Main as Main (CLI Entry)
participant FS as File System
participant Runner as run_analyze()
participant Parser as parse_private_key()
participant Analyzer as Analyzers (CPU/GPU)
User->>Main: vuke analyze [keys...] --key-file [path]
opt NEW: --key-file provided
Main->>FS: read_to_string(path)
FS-->>Main: file content
Main->>Main: NEW: Filter comments (#) and empty lines
Main->>Main: NEW: Append file keys to positional keys
end
Main->>Runner: CHANGED: run_analyze(key_inputs: &[String])
loop NEW: For each key_input in key_inputs
Runner->>Parser: parse_private_key(key_input)
Parser-->>Runner: Key object
loop For each enabled analyzer
Runner->>Analyzer: analyze(key, config)
Analyzer-->>Runner: Analysis Results
end
alt Human Output
opt NEW: If not first key
Runner->>User: CHANGED: Print blank line separator
end
Runner->>User: Print analysis report for current key
else JSON Output
Runner->>Runner: CHANGED: Buffer JSON object for this key
end
end
opt JSON Output
alt NEW: Multiple keys processed
Runner->>User: CHANGED: Print results as JSON Array
else Single key processed
Runner->>User: Print result as single JSON Object
end
end
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.rs`:
- Around line 257-263: The positional `key: Vec<String>` is currently declared
with #[arg(num_args = 1..)] which forces at least one positional and blocks
using --key-file; change the attribute to #[arg(num_args(0..))] or add required
= false so the positional becomes optional, leaving your application-level
empty-check (the existing "no keys provided" validation) to handle missing keys
when --key-file is used instead. Ensure you only modify the attribute on the
`key` field so clap no longer rejects invocations that rely solely on
`key_file`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1cc64995-3e7f-47ae-bd72-487265f135ed
📒 Files selected for processing (1)
src/main.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Order imports as: external crates → std → blank line →super::→ blank line →crate::
Prefer?operator over.unwrap()in new code
UsePascalCasefor types and structs
Usesnake_casefor function and method names
UseSCREAMING_SNAKE_CASEfor constants
Usesnake_casefor file and module names
Files:
src/main.rs
src/main.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/main.rs: Useanyhow::Result<T>andanyhow::bail!()for CLI and top-level error handling
CLI command and subcommand changes go insrc/main.rsusing clap derive macros
Files:
src/main.rs
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.rs: Useindicatif::ProgressBarfor long-running operations
Place inline tests in#[cfg(test)] mod testsat the end of each file, using standardassert!andassert_eq!macros
Usetempfilecrate for file I/O tests
Files:
src/main.rs
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : CLI command and subcommand changes go in `src/main.rs` using clap derive macros
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/*.rs : Process inputs as batch operations using `&[Input]` as input and `&mut Vec<(String, Key)>` as output, where the first tuple element is a human-readable source description
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Reuse PRNG implementations from `src/{prng}.rs` instead of duplicating shared logic
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Implement `supports_mask()` method and use `config.mask_bits` for masking support
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/{mt64,xorshift}.rs : Implement cascade filtering for 64-bit seed spaces (mt64, xorshift) with multi-target verification to avoid false positives
Applied to files:
src/main.rs
📚 Learning: 2026-03-13T13:20:58.369Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
Applied to files:
src/main.rs
…h errors Drop num_args=1.. so clap doesn't reject --key-file-only invocations. Bad keys now skip with an error instead of aborting the whole batch.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.rs`:
- Around line 1471-1473: The current logic only bails when had_error && multi,
so single-key parse failures still return success; update the error path so any
parse failure sets a non-zero exit: when had_error is true (regardless of multi)
propagate the error (use anyhow::bail or return Err) so the process exits
non‑zero; modify the conditional around had_error/multi (the block containing
anyhow::bail!("Some keys failed to parse")) to trigger on had_error alone and,
if desired, adjust the error message to indicate whether multiple keys failed
using the multi flag.
- Around line 1352-1371: The manual JSON construction around
matches_json/report/json_entries is unsafe; replace it by defining small
serde-serializable structs (e.g., MatchEntry with fields puzzle_id, address,
address_type, status, prize and ReportEntry with key, total_checked, matches)
derived with #[derive(Serialize)] and then use
serde_json::to_string(&report_entry) (or to_string for each MatchEntry and for
the whole ReportEntry) instead of format! strings; update the code that builds
matches_json and pushes into json_entries to construct these structs from report
and key_input and serialize via serde_json to ensure proper escaping and
Option<...> (prize) handling.
- Around line 1334-1338: The JSON escaping is incomplete in the
json_entries.push call where key_input and e.to_string() are interpolated;
replace the manual string formatting with proper JSON serialization (e.g., build
a small struct like { key: key_input.clone(), error: e.to_string() } or a
serde-serializable tuple and call serde_json::to_string) and push the resulting
serialized string into json_entries so newlines, backslashes and other
characters are correctly escaped; update references around
json_entries.push(...) in main.rs accordingly and import/derive serde Serialize
or call serde_json::to_string where used.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d7fb34c8-62a1-4171-8985-c07104c6f672
📒 Files selected for processing (1)
src/main.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Order imports as: external crates → std → blank line →super::→ blank line →crate::
Prefer?operator over.unwrap()in new code
UsePascalCasefor types and structs
Usesnake_casefor function and method names
UseSCREAMING_SNAKE_CASEfor constants
Usesnake_casefor file and module names
Files:
src/main.rs
src/main.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/main.rs: Useanyhow::Result<T>andanyhow::bail!()for CLI and top-level error handling
CLI command and subcommand changes go insrc/main.rsusing clap derive macros
Files:
src/main.rs
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.rs: Useindicatif::ProgressBarfor long-running operations
Place inline tests in#[cfg(test)] mod testsat the end of each file, using standardassert!andassert_eq!macros
Usetempfilecrate for file I/O tests
Files:
src/main.rs
🧠 Learnings (13)
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : CLI command and subcommand changes go in `src/main.rs` using clap derive macros
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Reuse PRNG implementations from `src/{prng}.rs` instead of duplicating shared logic
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/*.rs : Process inputs as batch operations using `&[Input]` as input and `&mut Vec<(String, Key)>` as output, where the first tuple element is a human-readable source description
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use Rayon `par_iter()` for CPU parallelism in brute-force operations
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Implement `supports_mask()` method and use `config.mask_bits` for masking support
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/{mt64,xorshift}.rs : Implement cascade filtering for 64-bit seed spaces (mt64, xorshift) with multi-target verification to avoid false positives
Applied to files:
src/main.rs
📚 Learning: 2026-03-13T13:20:58.369Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
Applied to files:
src/main.rs
🔇 Additional comments (3)
src/main.rs (3)
257-262: LGTM - The previousnum_args=1..issue is resolved. Positional keys now default to 0+ allowing--key-fileonly invocations, with the empty check at line 461 catching missing keys at app level.
449-463: LGTM - Key merging logic is clean. File reading with?operator, proper line filtering for comments/empty lines, and clear error message if no keys provided.
1416-1461: LGTM - Analyzer loop correctly reuses the GPU context across all keys (no per-key initialization overhead). Progress bars, GPU-first-with-fallback, and result collection all look correct.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/main.rs">
<violation number="1" location="src/main.rs:1471">
P2: Single-key parse failures now return success because the final error check is gated by `multi`. Invalid input should still produce a non-zero exit.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.rs`:
- Around line 1340-1343: The JSON being built interpolates key_input raw which
breaks output when the key contains quotes or special chars; add a helper fn
escape_json_string(s: &str) -> String (or reuse the existing escaping used for
err_msg) and call it for key_input before formatting into json_entries (the
json_entries.push(format!(...)) site), so both key_input and err_msg are escaped
consistently and the produced JSON remains valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 58b5648a-4f57-46db-a0b1-8c8a545ec9af
📒 Files selected for processing (1)
src/main.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Order imports as: external crates → std → blank line →super::→ blank line →crate::
Prefer?operator over.unwrap()in new code
UsePascalCasefor types and structs
Usesnake_casefor function and method names
UseSCREAMING_SNAKE_CASEfor constants
Usesnake_casefor file and module names
Files:
src/main.rs
src/main.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/main.rs: Useanyhow::Result<T>andanyhow::bail!()for CLI and top-level error handling
CLI command and subcommand changes go insrc/main.rsusing clap derive macros
Files:
src/main.rs
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.rs: Useindicatif::ProgressBarfor long-running operations
Place inline tests in#[cfg(test)] mod testsat the end of each file, using standardassert!andassert_eq!macros
Usetempfilecrate for file I/O tests
Files:
src/main.rs
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Reuse PRNG implementations from `src/{prng}.rs` instead of duplicating shared logic
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : CLI command and subcommand changes go in `src/main.rs` using clap derive macros
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Implement `supports_mask()` method and use `config.mask_bits` for masking support
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/*.rs : Process inputs as batch operations using `&[Input]` as input and `&mut Vec<(String, Key)>` as output, where the first tuple element is a human-readable source description
Applied to files:
src/main.rs
📚 Learning: 2026-03-13T13:20:58.369Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use `AtomicBool` for early termination flag across threads in parallel brute-force search
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : Use `anyhow::Result<T>` and `anyhow::bail!()` for CLI and top-level error handling
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/{mt64,xorshift}.rs : Implement cascade filtering for 64-bit seed spaces (mt64, xorshift) with multi-target verification to avoid false positives
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use Rayon `par_iter()` for CPU parallelism in brute-force operations
Applied to files:
src/main.rs
📚 Learning: 2026-03-05T12:40:29.177Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 64
File: src/source/mod.rs:26-32
Timestamp: 2026-03-05T12:40:29.177Z
Learning: In `oritwoen/vuke`, `AGENTS.md` and `src/source/AGENTS.md` describe an **aspirational/future** `Source::process` trait signature (generic `T: Transform`, `O: Output`, with `no_gpu: bool` and `progress: Option<&ProgressBar>` parameters). The **current** implementation in `src/source/mod.rs` uses dynamic dispatch: `fn process(&self, transforms: &[Box<dyn Transform>], deriver: &KeyDeriver, matcher: Option<&Matcher>, output: &dyn Output) -> Result<ProcessStats>`. Migrating to the generic form is blocked by object-safety requirements (`Box<dyn Source>` is used in `src/main.rs`) and is a tracked future refactor. Do not flag the current dynamic-dispatch signature as non-conformant with AGENTS.md.
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:25:01.029Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/output/AGENTS.md:0-0
Timestamp: 2026-03-12T18:25:01.029Z
Learning: Applies to src/output/console.rs : Compact CSV format for file output should be: `source,transform,privkey_hex,address`
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/{transform,source,analyze}/**/*.rs : Use `AtomicBool` for early termination signaling across Rayon threads
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:25:01.029Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/output/AGENTS.md:0-0
Timestamp: 2026-03-12T18:25:01.029Z
Learning: Applies to src/output/**/*.rs : Output trait must implement three methods: `key()`, `hit()`, and `flush()` with specified signatures
Applied to files:
src/main.rs
📚 Learning: 2026-03-22T18:38:29.431Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 86
File: src/provider.rs:442-443
Timestamp: 2026-03-22T18:38:29.431Z
Learning: In oritwoen/vuke src/provider.rs, the `derived.p2tr == addr` branch in `verify_key_boha` has no test coverage intentionally — no boha puzzles currently have P2TR/Taproot addresses. The branch is forward-compatible for when taproot puzzles are added to boha. Do not flag missing P2TR test coverage in this function.
Applied to files:
src/main.rs
🔇 Additional comments (5)
src/main.rs (5)
1357-1376: Verify report JSON still has no escapingSame issue as flagged before -
puzzle_id,address,address_type,status, andkey_input(line 1373) are all raw-interpolated. If any field contains a quote or backslash, JSON breaks.Consider a
#[derive(Serialize)]struct andserde_json::to_string()for robust escaping, or at minimum apply the same escape helper to all string fields.
257-262: LGTM - positional keys now optionalThe default
0..lets--key-filework standalone. App-level empty check handles the "nothing provided" case.
449-463: LGTM - key merging logicClean file parsing with comment filtering. Early bail with clear message when no keys provided.
1421-1456: LGTM - analyzer execution loopPer-key analysis with GPU-first fallback. Progress bars for brute-force only. Feature gates are correct.
1468-1478: LGTM - output aggregation and exit handlingSingle key → plain JSON object (backwards compatible). Multiple keys → array. Exit code correctly non-zero when any parse fails.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.rs`:
- Line 1329: The separator newline logic currently uses the input index (for (i,
key_input) in key_inputs.iter().enumerate()) to decide whether to print a blank
line, which causes a leading blank when earlier inputs only wrote to stderr;
change the logic to track whether any text has actually been printed to stdout
using a boolean (e.g., printed_any_text_output) instead of i > 0, initialize it
false before the loops, check that flag before emitting the separator, and set
it to true whenever you write the first stdout section (update the same pattern
in the other loops that use i > 0 — the blocks referenced around the other
key-input loops — so all separators rely on printed_any_text_output).
- Around line 1326-1327: The current code collects all per-key JSON blobs into
json_entries and uses join(), buffering the entire output in memory; change the
logic in src/main.rs to stream the JSON array instead: emit `[` once before
producing entries, replace accumulating into `json_entries` by writing each
produced JSON entry immediately to stdout (or the chosen writer), use a boolean
first_entry flag to prefix commas only between entries, and then emit `]` at the
end (ensuring had_error is still set/checked appropriately). Remove the final
join() that concatenates the Vec and any code that assumes json_entries exists;
apply the same streaming refactor to the other block around the 1459-1474 range
so large --json runs don’t buffer all results in RAM.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6b221ae9-3de7-4c06-aa08-4ebb3a26f346
📒 Files selected for processing (1)
src/main.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Order imports as: external crates → std → blank line →super::→ blank line →crate::
Prefer?operator over.unwrap()in new code
UsePascalCasefor types and structs
Usesnake_casefor function and method names
UseSCREAMING_SNAKE_CASEfor constants
Usesnake_casefor file and module names
Files:
src/main.rs
src/main.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/main.rs: Useanyhow::Result<T>andanyhow::bail!()for CLI and top-level error handling
CLI command and subcommand changes go insrc/main.rsusing clap derive macros
Files:
src/main.rs
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.rs: Useindicatif::ProgressBarfor long-running operations
Place inline tests in#[cfg(test)] mod testsat the end of each file, using standardassert!andassert_eq!macros
Usetempfilecrate for file I/O tests
Files:
src/main.rs
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : CLI command and subcommand changes go in `src/main.rs` using clap derive macros
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Reuse PRNG implementations from `src/{prng}.rs` instead of duplicating shared logic
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/{transform,analyze}/mod.rs : Use factory enums with `create()` and `FromStr` for parsing CLI strings in `TransformType` and `AnalyzerType`
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Implement `supports_mask()` method and use `config.mask_bits` for masking support
Applied to files:
src/main.rs
📚 Learning: 2026-03-13T13:20:58.369Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use `AtomicBool` for early termination flag across threads in parallel brute-force search
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : Use `anyhow::Result<T>` and `anyhow::bail!()` for CLI and top-level error handling
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/{mt64,xorshift}.rs : Implement cascade filtering for 64-bit seed spaces (mt64, xorshift) with multi-target verification to avoid false positives
Applied to files:
src/main.rs
📚 Learning: 2026-03-05T12:40:29.177Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 64
File: src/source/mod.rs:26-32
Timestamp: 2026-03-05T12:40:29.177Z
Learning: In `oritwoen/vuke`, `AGENTS.md` and `src/source/AGENTS.md` describe an **aspirational/future** `Source::process` trait signature (generic `T: Transform`, `O: Output`, with `no_gpu: bool` and `progress: Option<&ProgressBar>` parameters). The **current** implementation in `src/source/mod.rs` uses dynamic dispatch: `fn process(&self, transforms: &[Box<dyn Transform>], deriver: &KeyDeriver, matcher: Option<&Matcher>, output: &dyn Output) -> Result<ProcessStats>`. Migrating to the generic form is blocked by object-safety requirements (`Box<dyn Source>` is used in `src/main.rs`) and is a tracked future refactor. Do not flag the current dynamic-dispatch signature as non-conformant with AGENTS.md.
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use Rayon `par_iter()` for CPU parallelism in brute-force operations
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:25:01.029Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/output/AGENTS.md:0-0
Timestamp: 2026-03-12T18:25:01.029Z
Learning: Applies to src/output/console.rs : Compact CSV format for file output should be: `source,transform,privkey_hex,address`
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:24:52.371Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/{transform,source,analyze}/**/*.rs : Use `AtomicBool` for early termination signaling across Rayon threads
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:25:01.029Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/output/AGENTS.md:0-0
Timestamp: 2026-03-12T18:25:01.029Z
Learning: Applies to src/output/**/*.rs : Output trait must implement three methods: `key()`, `hit()`, and `flush()` with specified signatures
Applied to files:
src/main.rs
📚 Learning: 2026-03-22T18:38:29.431Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 86
File: src/provider.rs:442-443
Timestamp: 2026-03-22T18:38:29.431Z
Learning: In oritwoen/vuke src/provider.rs, the `derived.p2tr == addr` branch in `verify_key_boha` has no test coverage intentionally — no boha puzzles currently have P2TR/Taproot addresses. The branch is forward-compatible for when taproot puzzles are added to boha. Do not flag missing P2TR test coverage in this function.
Applied to files:
src/main.rs
📚 Learning: 2026-03-12T18:25:01.029Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/output/AGENTS.md:0-0
Timestamp: 2026-03-12T18:25:01.029Z
Learning: Applies to src/output/**/*.rs : Use `escape_csv_field()` from `mod.rs` for any field written to CSV in the output module
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use `indicatif::ProgressBar` for progress indication in long-running operations
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:08.405Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : 64-bit seed spaces (mt64, xorshift) MUST use cascade filter for verification
Applied to files:
src/main.rs
📚 Learning: 2026-03-02T14:18:44.316Z
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/*.rs : Process inputs as batch operations using `&[Input]` as input and `&mut Vec<(String, Key)>` as output, where the first tuple element is a human-readable source description
Applied to files:
src/main.rs
| let mut json_entries = Vec::new(); | ||
| let mut had_error = false; |
There was a problem hiding this comment.
--json batch mode buffers the whole run in RAM.
Every per-key JSON blob stays in json_entries until the end, then join() allocates one more full copy. vuke analyze --json --key-file big.txt now scales memory with total result size and delays all output until the last key finishes. Stream the array instead: print [ once, write each entry as it is produced with a first_entry flag, then close ].
Also applies to: 1459-1474
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main.rs` around lines 1326 - 1327, The current code collects all per-key
JSON blobs into json_entries and uses join(), buffering the entire output in
memory; change the logic in src/main.rs to stream the JSON array instead: emit
`[` once before producing entries, replace accumulating into `json_entries` by
writing each produced JSON entry immediately to stdout (or the chosen writer),
use a boolean first_entry flag to prefix commas only between entries, and then
emit `]` at the end (ensuring had_error is still set/checked appropriately).
Remove the final join() that concatenates the Vec and any code that assumes
json_entries exists; apply the same streaming refactor to the other block around
the 1459-1474 range so large --json runs don’t buffer all results in RAM.
There was a problem hiding this comment.
For a CLI tool processing key files, we're talking hundreds or thousands of keys at most. Buffering a few KB of JSON strings is fine here - streaming would add complexity for no practical gain.
There was a problem hiding this comment.
@oritwoen, fair point. For a key-analysis CLI the dataset is naturally bounded by what a human would actually review, so the buffering cost is negligible in practice. The added complexity of streaming isn't worth it here. Acknowledged.
🧠 Learnings used
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/output.rs : Format analysis results as plain text and JSON using utilities in `output.rs`
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/*.rs : Process inputs as batch operations using `&[Input]` as input and `&mut Vec<(String, Key)>` as output, where the first tuple element is a human-readable source description
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,mt64,lcg,xorshift,sha256_chain}.rs : Use Rayon `par_iter()` for CPU parallelism in brute-force operations
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/main.rs : CLI command and subcommand changes go in `src/main.rs` using clap derive macros
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/transform/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:44.316Z
Learning: Applies to src/transform/src/analyze/*.rs : For reversible transforms, create a corresponding analyzer at `src/analyze/{name}.rs` to support key recovery analysis
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T18:24:52.371Z
Learning: Applies to src/analyze/**/*.rs : Use masked analysis pattern `(full_key & ((1<<N)-1)) | (1<<(N-1))` for puzzle solving
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Add new analyzer by creating `{name}.rs`, adding to `mod.rs`, and extending `AnalyzerType` enum
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{mt64,xorshift}.rs : Use `config.cascade_targets` for multi-target verification in cascade filtering
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/*.rs : Reuse PRNG implementations from `src/{prng}.rs` instead of duplicating shared logic
Learnt from: CR
Repo: oritwoen/vuke PR: 0
File: src/analyze/AGENTS.md:0-0
Timestamp: 2026-03-02T14:18:08.405Z
Learning: Applies to src/analyze/analyze/{milksad,sha256_chain}.rs : Implement `supports_gpu()` and `analyze_gpu()` methods for GPU-accelerated analyzers
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/main.rs">
<violation number="1" location="src/main.rs:1342">
P2: `key_input` is written into JSON without escaping, so certain key strings produce invalid JSON output.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
src/main.rs
Outdated
| .replace('\t', "\\t"); | ||
| json_entries.push(format!( | ||
| r#"{{"key":"{}","error":"{}"}}"#, | ||
| key_input, err_msg |
There was a problem hiding this comment.
P2: key_input is written into JSON without escaping, so certain key strings produce invalid JSON output.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main.rs, line 1342:
<comment>`key_input` is written into JSON without escaping, so certain key strings produce invalid JSON output.</comment>
<file context>
@@ -1331,10 +1331,15 @@ fn run_analyze(
r#"{{"key":"{}","error":"{}"}}"#,
- key_input,
- e.to_string().replace('"', "\\\"")
+ key_input, err_msg
));
} else {
</file context>
vuke analyzeonly took a single key. When investigating a cluster of related keys you had to run the command once per key, which gets tedious fast.Now it accepts multiple positional args and a
--key-fileflag:Each key runs through the selected analyzers independently. Human output separates keys with blank lines, JSON wraps results in an array when there's more than one key (single key still returns a plain object for backwards compat).
--key-filereads one key per line, same formatsparse_private_keyalready handles (hex, WIF, decimal). Lines starting with#are skipped.Closes #84