-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli-finding-classifier): Phase b' lint-screen evals — N=12 + multi-metrics + prompt v3 (83.3% GO) #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/cli-finding-classifier/evals/files/eval10-nesting-boundary.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # SYNTHETIC FIXTURE: eval10-nesting-boundary | ||
| # issue_pattern: nesting がちょうど 4 levels (閾値 'deeper than 4' を超えない) | ||
| # expected_screen_decision: informational | ||
| # verification_purpose: prompt template の 4 levels 閾値を厳密に解釈するか (boundary case) | ||
| diff --git a/src/check.rs b/src/check.rs | ||
| index 1111111..2222222 100644 | ||
| --- a/src/check.rs | ||
| +++ b/src/check.rs | ||
| @@ -1,3 +1,15 @@ | ||
| pub fn approve(req: &Request) -> bool { | ||
| + if req.user.is_active() { | ||
| + if req.user.has_role("admin") { | ||
| + if req.resource.is_visible() { | ||
| + if req.resource.is_published() { | ||
| + return true; | ||
| + } | ||
| + } | ||
| + } | ||
| + } | ||
| + false | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/cli-finding-classifier/evals/files/eval11-comment-only.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # SYNTHETIC FIXTURE: eval11-comment-only | ||
| # issue_pattern: コメント追加のみ (コードロジック不変) | ||
| # expected_screen_decision: informational | ||
| # verification_purpose: コメント追加を modification として誤検知しない (false-positive 抑制) | ||
| diff --git a/src/utils.rs b/src/utils.rs | ||
| index 3333333..4444444 100644 | ||
| --- a/src/utils.rs | ||
| +++ b/src/utils.rs | ||
| @@ -1,8 +1,12 @@ | ||
| +/// Trims whitespace from both ends of `s`. | ||
| +/// | ||
| +/// Returns a String, since &str cannot own data. | ||
| pub fn trim(s: &str) -> String { | ||
| s.trim().to_string() | ||
| } | ||
|
|
||
| pub fn lines(s: &str) -> Vec<&str> { | ||
| + // Split on newlines, preserving empty lines | ||
| s.lines().collect() | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/cli-finding-classifier/evals/files/eval12-test-cfg.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # SYNTHETIC FIXTURE: eval12-test-cfg | ||
| # issue_pattern: #[cfg(test)] 内の dead code (test 慣用、意図的に未使用 helper を含む) | ||
| # expected_screen_decision: informational | ||
| # verification_purpose: prompt template の "test-only patterns inside #[cfg(test)]" 指示を LLM が遵守するか | ||
| diff --git a/src/widget.rs b/src/widget.rs | ||
| index 5555555..6666666 100644 | ||
| --- a/src/widget.rs | ||
| +++ b/src/widget.rs | ||
| @@ -10,6 +10,18 @@ impl Widget { | ||
| self.size | ||
| } | ||
| } | ||
| + | ||
| +#[cfg(test)] | ||
| +mod tests { | ||
| + use super::*; | ||
| + | ||
| + fn unused_helper() -> Widget { | ||
| + Widget::new(0) | ||
| + } | ||
| + | ||
| + #[test] | ||
| + fn computes_size() { | ||
| + let w = Widget::new(42); | ||
| + assert_eq!(w.size(), 42); | ||
| + } | ||
| +} |
19 changes: 19 additions & 0 deletions
19
src/cli-finding-classifier/evals/files/eval7-style-only.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # SYNTHETIC FIXTURE: eval7-style-only | ||
| # issue_pattern: whitespace-only changes (no semantic diff) | ||
| # expected_screen_decision: informational | ||
| # verification_purpose: LLM が style-only 変更を flag しない (false-positive 抑制) | ||
| diff --git a/src/format.rs b/src/format.rs | ||
| index aaaaaaa..bbbbbbb 100644 | ||
| --- a/src/format.rs | ||
| +++ b/src/format.rs | ||
| @@ -1,7 +1,7 @@ | ||
| -pub fn format_value(v: &str) -> String { | ||
| - v.trim().to_string() | ||
| -} | ||
| +pub fn format_value( v: &str ) -> String { | ||
| + v.trim( ).to_string( ) | ||
| +} | ||
|
|
||
| pub fn count(s: &str) -> usize { | ||
| s.len() | ||
| } |
67 changes: 67 additions & 0 deletions
67
src/cli-finding-classifier/evals/files/eval8-large-refactor.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # SYNTHETIC FIXTURE: eval8-large-refactor | ||
| # issue_pattern: 3 file / 80+ 行の architectural addition + magic-number 1 件 (3600) | ||
| # expected_screen_decision: auto_fix | ||
| # verification_purpose: 大規模 context 内で magic-number を取りこぼさず拾えるか | ||
| diff --git a/src/auth/mod.rs b/src/auth/mod.rs | ||
| index aaaaaaa..bbbbbbb 100644 | ||
| --- a/src/auth/mod.rs | ||
| +++ b/src/auth/mod.rs | ||
| @@ -1,5 +1,15 @@ | ||
| +pub mod session; | ||
| +pub mod token; | ||
| + | ||
| pub struct Auth { /* ... */ } | ||
| + | ||
| +impl Auth { | ||
| + pub fn authenticate(&self, user: &str, pass: &str) -> Result<token::Token, AuthError> { | ||
| + let session = self.create_session(user, pass)?; | ||
| + let issued = self.issue_token(session.id())?; | ||
| + Ok(issued) | ||
| + } | ||
| +} | ||
| diff --git a/src/auth/session.rs b/src/auth/session.rs | ||
| new file mode 100644 | ||
| index 0000000..ccccccc | ||
| --- /dev/null | ||
| +++ b/src/auth/session.rs | ||
| @@ -0,0 +1,23 @@ | ||
| +use std::time::Duration; | ||
| + | ||
| +pub struct Session { | ||
| + id: String, | ||
| + ttl: Duration, | ||
| +} | ||
| + | ||
| +impl Session { | ||
| + pub fn new(id: String) -> Self { | ||
| + Self { | ||
| + id, | ||
| + ttl: Duration::from_secs(3600), | ||
| + } | ||
|
aloekun marked this conversation as resolved.
|
||
| + } | ||
| + | ||
| + pub fn id(&self) -> &str { | ||
| + &self.id | ||
| + } | ||
| + | ||
| + pub fn ttl(&self) -> Duration { | ||
| + self.ttl | ||
| + } | ||
| +} | ||
| diff --git a/src/auth/token.rs b/src/auth/token.rs | ||
| new file mode 100644 | ||
| index 0000000..ddddddd | ||
| --- /dev/null | ||
| +++ b/src/auth/token.rs | ||
| @@ -0,0 +1,12 @@ | ||
| +pub struct Token(String); | ||
| + | ||
| +impl Token { | ||
| + pub fn new(value: String) -> Self { | ||
| + Self(value) | ||
| + } | ||
| + | ||
| + pub fn value(&self) -> &str { | ||
| + &self.0 | ||
| + } | ||
| +} | ||
18 changes: 18 additions & 0 deletions
18
src/cli-finding-classifier/evals/files/eval9-multi-import-leak.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # SYNTHETIC FIXTURE: eval9-multi-import-leak | ||
| # issue_pattern: unused-import × 4 (HashMap / BTreeMap / Path / Value) | ||
| # expected_screen_decision: auto_fix | ||
| # verification_purpose: 複数 issue 取りこぼし stress test (recall 軸) | ||
| diff --git a/src/parser.rs b/src/parser.rs | ||
| index eeeeeee..fffffff 100644 | ||
| --- a/src/parser.rs | ||
| +++ b/src/parser.rs | ||
| @@ -1,5 +1,9 @@ | ||
| +use std::collections::HashMap; | ||
| +use std::collections::BTreeMap; | ||
| +use std::path::Path; | ||
| +use serde_json::Value; | ||
| use std::fs; | ||
|
|
||
| pub fn parse(path: &str) -> std::io::Result<String> { | ||
| fs::read_to_string(path) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.