mirror of
https://github.com/SikongJueluo/pi-extensions.git
synced 2026-10-05 11:52:55 +08:00
refactor(ai-judge): split remaining hotspots and cover CRAP branches
- stage-ify judgeAuthorize into auditEnrollment, runPreflightGates, prepareModelCall, and enforceAndEmit - extract tallyJoinedRows and tallyAttributable from computeMetrics, removing three dead locals - extract validateVerdictResponse from requestStructuredVerdict - extract collectUserTexts and charBudgetStart from buildConversationEvidence - table-drive corpus-replay parseArgs and split main into resolveReplayModel, selectCorpusCases, and replayCorpus - split analyzer cli main into loadReviewEvents, withinWindow, loadAuditEnrolled, and printReport with a run-as-script guard - add 81 tests covering parseEntry, extractBashCommandEvidence, validateVerdictResponse, forcedToolChoice, classifyGit dry-run paths, CLI arg/window/report rendering, and the infra-failure result path - add @vitest/coverage-istanbul for exact per-function CRAP scoring via fallow health --coverage
This commit is contained in:
@@ -28,9 +28,14 @@ describe("classifyHighRisk — data_loss", () => {
|
||||
it.each([
|
||||
"git clean -nxd",
|
||||
"git clean -nd",
|
||||
"git clean -nxfd",
|
||||
"git clean -f -x -n",
|
||||
"git clean -fd",
|
||||
"git clean -xn",
|
||||
"git reset --soft HEAD~1",
|
||||
"git checkout main",
|
||||
"git checkout -- file.txt",
|
||||
"git checkout . file.txt",
|
||||
"git restore file.txt",
|
||||
"rm -rf build/",
|
||||
"rm -rf ./dist",
|
||||
|
||||
Reference in New Issue
Block a user