feat(scoring): transition workflow learning and fix history UX (#39)
- add transition scoring engine to learn sequential workflows per directory using command skeletons - prioritize current active git branch over older branches in suggestions - restore strict chronological order for history navigation and bypass AI re-ranking - add in-memory session history for instant access to just-run commands - fix PTY prompt not syncing when using arrow keys in the history menu - fix history tie-breaker to properly prioritize newer commands by assigning larger IDs - fix potential mutex deadlock between bufferMu and pty write during history navigation - fix workspace git detection to remove depth limits and correctly identify repositories with detached HEADs - fix SQLite connection leaks in frecency queries - fix global state leaks in history tests by snapshotting and restoring registry states - modernize string prefix checks using strings.CutPrefix
This commit is contained in:
@@ -61,6 +61,18 @@ func TestApplyContextRules_MultiEcosystem(t *testing.T) {
|
||||
cmd: "kubectl get pods",
|
||||
expected: 40,
|
||||
},
|
||||
{
|
||||
name: "git push active branch gets double bonus clamped to 100",
|
||||
ws: workspace.WorkspaceInfo{HasGit: true, GitBranch: "fix/scoring"},
|
||||
cmd: "git push origin fix/scoring",
|
||||
expected: 100, // 40 (git push) + 60 (active branch) = 100
|
||||
},
|
||||
{
|
||||
name: "git push other branch gets normal git push bonus only",
|
||||
ws: workspace.WorkspaceInfo{HasGit: true, GitBranch: "fix/scoring"},
|
||||
cmd: "git push origin fix/alias",
|
||||
expected: 40,
|
||||
},
|
||||
{
|
||||
name: "unrelated command gets no bonus",
|
||||
ws: workspace.WorkspaceInfo{HasGit: true},
|
||||
|
||||
Reference in New Issue
Block a user