@devflow-tools/benchmark 0.16.27 → 0.16.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/repeated-trials.d.ts +1 -0
  2. package/dist/repeated-trials.d.ts.map +1 -1
  3. package/dist/repeated-trials.js +1 -0
  4. package/dist/repeated-trials.js.map +1 -1
  5. package/dist/retrieval-quality-corpus.d.ts +23 -0
  6. package/dist/retrieval-quality-corpus.d.ts.map +1 -1
  7. package/dist/retrieval-quality-corpus.js +72 -9
  8. package/dist/retrieval-quality-corpus.js.map +1 -1
  9. package/dist/retrieval-quality.d.ts +47 -0
  10. package/dist/retrieval-quality.d.ts.map +1 -1
  11. package/dist/retrieval-quality.js +146 -2
  12. package/dist/retrieval-quality.js.map +1 -1
  13. package/fixtures/projects/react-video/.devflow/.force-init +1 -1
  14. package/fixtures/projects/react-video/.devflow/knowledge/knowledge.db +0 -0
  15. package/fixtures/projects/react-video/.devflow/memory/memories.db +0 -0
  16. package/fixtures/projects/rsbuild-react-quality/.codegraph/.gitignore +5 -0
  17. package/fixtures/projects/rsbuild-react-quality/.devflow/.force-init +1 -0
  18. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/angular/manifest.json +13 -0
  19. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/knowledge.db +0 -0
  20. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/nest/manifest.json +13 -0
  21. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/nextjs/manifest.json +13 -0
  22. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/node/manifest.json +13 -0
  23. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/prisma/manifest.json +13 -0
  24. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/react/chunk-001.json +8 -0
  25. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/react/manifest.json +13 -0
  26. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/tailwind/manifest.json +13 -0
  27. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/typescript/manifest.json +13 -0
  28. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/vitest/manifest.json +13 -0
  29. package/fixtures/projects/rsbuild-react-quality/.devflow/knowledge/vue/manifest.json +13 -0
  30. package/fixtures/projects/rsbuild-react-quality/.devflow/memory/memories.db +0 -0
  31. package/fixtures/projects/rsbuild-react-quality/.devflow/symbols-vec.db +0 -0
  32. package/fixtures/projects/rsbuild-react-quality/components.json +7 -0
  33. package/fixtures/projects/rsbuild-react-quality/package.json +17 -0
  34. package/fixtures/projects/rsbuild-react-quality/src/components/Login.tsx +14 -0
  35. package/fixtures/retrieval-quality-corpus.json +57 -2
  36. package/fixtures/retrieval-quality-devflow.json +5 -3
  37. package/fixtures/retrieval-quality-react-video.json +63 -1
  38. package/fixtures/retrieval-quality-rsbuild-react.json +93 -0
  39. package/fixtures/retrieval-quality.json +5 -2
  40. package/package.json +5 -5
@@ -1,18 +1,36 @@
1
1
  {
2
2
  "schemaVersion": "devflow.retrieval-quality-corpus.v1",
3
3
  "maxTokenGrowthRatio": 0.5,
4
+ "trialCount": 3,
5
+ "requiredAcceptanceClasses": [
6
+ "exact-positive", "paraphrase", "mixed-language", "expected-empty", "out-of-domain",
7
+ "incompatible-version", "stale-file", "weak-graph", "embedding-degraded",
8
+ "reranker-unavailable", "policy-action", "session-end-reconciliation"
9
+ ],
4
10
  "projects": [
5
11
  {
6
12
  "id": "devflow",
7
13
  "projectRoot": "../../..",
8
14
  "fixturePath": "retrieval-quality-devflow.json",
9
- "prepareCodeGraph": true
15
+ "prepareCodeGraph": true,
16
+ "acceptanceClasses": ["exact-positive", "policy-action", "session-end-reconciliation"]
10
17
  },
11
18
  {
12
19
  "id": "react-video",
13
20
  "projectRoot": "projects/react-video",
14
21
  "fixturePath": "retrieval-quality-react-video.json",
15
- "prepareCodeGraph": true
22
+ "prepareCodeGraph": true,
23
+ "acceptanceClasses": [
24
+ "paraphrase", "mixed-language", "expected-empty", "out-of-domain",
25
+ "incompatible-version", "stale-file", "weak-graph", "embedding-degraded", "reranker-unavailable"
26
+ ]
27
+ },
28
+ {
29
+ "id": "rsbuild-react-quality",
30
+ "projectRoot": "projects/rsbuild-react-quality",
31
+ "fixturePath": "retrieval-quality-rsbuild-react.json",
32
+ "prepareCodeGraph": true,
33
+ "acceptanceClasses": ["exact-positive", "expected-empty", "policy-action", "embedding-degraded"]
16
34
  },
17
35
  {
18
36
  "id": "rsbuild-react",
@@ -21,5 +39,42 @@
21
39
  "optional": true,
22
40
  "deferred": true
23
41
  }
42
+ ],
43
+ "authoritativeScenarios": [
44
+ {
45
+ "id": "http-expected-empty",
46
+ "acceptanceClasses": ["expected-empty", "out-of-domain"],
47
+ "expected": { "memoryIds": [], "coverageGaps": ["knowledge_source_missing"], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "devflow_unsupported_action", "verification": ["unknown"], "ledgerTransitions": ["selected", "exposed", "unknown"] }
48
+ },
49
+ {
50
+ "id": "prettier-explicit-immediate",
51
+ "acceptanceClasses": ["exact-positive", "policy-action"],
52
+ "expected": { "memoryIds": ["prettier-project-policy"], "memoryFacets": ["formatting"], "knowledgeSources": [], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_refactor_component", "verification": ["formatter", "typecheck"], "ledgerTransitions": ["selected", "exposed", "adopted", "positive_outcome"] }
53
+ },
54
+ {
55
+ "id": "login-tailwind-shadcn-prettier",
56
+ "acceptanceClasses": ["mixed-language", "policy-action"],
57
+ "expected": { "memoryFacets": ["formatting", "styling", "component_library"], "knowledgeSources": ["react", "tailwindcss"], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_new_component", "verification": ["formatter", "typecheck"], "ledgerTransitions": ["eligible", "candidate", "selected", "exposed", "adopted", "positive_outcome"] }
58
+ },
59
+ {
60
+ "id": "successful-grep-no-learning",
61
+ "acceptanceClasses": ["expected-empty"],
62
+ "expected": { "memoryIds": [], "coverageGaps": [], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_audit_performance", "verification": ["unknown"], "ledgerTransitions": ["selected", "exposed", "unknown"] }
63
+ },
64
+ {
65
+ "id": "stale-component-exclusion",
66
+ "acceptanceClasses": ["stale-file", "weak-graph"],
67
+ "expected": { "memoryIds": [], "coverageGaps": [], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_review_hooks", "verification": ["unknown"], "ledgerTransitions": ["rejected", "selected", "exposed", "unknown"] }
68
+ },
69
+ {
70
+ "id": "api-specific-knowledge-rejection",
71
+ "acceptanceClasses": ["incompatible-version", "embedding-degraded", "reranker-unavailable"],
72
+ "expected": { "memoryIds": [], "knowledgeSources": ["react"], "knowledgeChunks": ["api"], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_review_hooks", "verification": ["unknown"], "ledgerTransitions": ["candidate", "rejected", "selected", "exposed", "unknown"] }
73
+ },
74
+ {
75
+ "id": "session-exit-closure",
76
+ "acceptanceClasses": ["session-end-reconciliation"],
77
+ "expected": { "memoryIds": [], "coverageGaps": [], "codePaths": ["src/components/Login.tsx"], "codeRoles": ["target"], "domainAction": "react_audit_performance", "verification": ["session_end_receipt"], "ledgerTransitions": ["selected", "exposed", "unknown"] }
78
+ }
24
79
  ]
25
80
  }
@@ -2,15 +2,18 @@
2
2
  "schemaVersion": "devflow.retrieval-quality.v1",
3
3
  "thresholds": {
4
4
  "codeFileRecallAt5": 0.85,
5
- "codeFilePrecisionAt5": 0.75,
5
+ "codeFilePrecisionAt5": 0.85,
6
6
  "symbolNdcgAt5": 0.8,
7
7
  "falseCrossFileEdgeRate": 0.01,
8
8
  "memoryPrecisionAt5": 0.8,
9
9
  "expectedEmptyMemoryAccuracy": 1,
10
10
  "knowledgeNdcgAt5": 0.85,
11
+ "knowledgePrecisionAt3": 0.8,
11
12
  "knowledgeVectorCoverage": 0.95,
12
13
  "knowledgeChunkP95": 3000,
13
14
  "knowledgeVersionMatch": 1,
15
+ "maxKnowledgeInjectionViolations": 0,
16
+ "maxStaleSelectedFiles": 0,
14
17
  "maxRetrievalCycle": 3
15
18
  },
16
19
  "queries": [
@@ -22,8 +25,7 @@
22
25
  { "path": "packages/database/src/database.ts", "role": "target" },
23
26
  { "path": "packages/database/__tests__/database.host-actions.test.ts", "role": "caller" },
24
27
  { "path": "packages/database/__tests__/database.memory-turn-receipts.test.ts", "role": "caller" },
25
- { "path": "packages/database/src/retrieval-sessions.ts", "role": "dependency" },
26
- { "path": "packages/database/src/types.ts", "role": "dependency" }
28
+ { "path": "packages/database/src/retrieval-sessions.ts", "role": "target" }
27
29
  ],
28
30
  "expectedEmptyMemory": true
29
31
  }
@@ -2,15 +2,18 @@
2
2
  "schemaVersion": "devflow.retrieval-quality.v1",
3
3
  "thresholds": {
4
4
  "codeFileRecallAt5": 0.85,
5
- "codeFilePrecisionAt5": 0.75,
5
+ "codeFilePrecisionAt5": 0.85,
6
6
  "symbolNdcgAt5": 0.8,
7
7
  "falseCrossFileEdgeRate": 0.01,
8
8
  "memoryPrecisionAt5": 0.8,
9
9
  "expectedEmptyMemoryAccuracy": 1,
10
10
  "knowledgeNdcgAt5": 0.85,
11
+ "knowledgePrecisionAt3": 0.8,
11
12
  "knowledgeVectorCoverage": 0.95,
12
13
  "knowledgeChunkP95": 3000,
13
14
  "knowledgeVersionMatch": 1,
15
+ "maxKnowledgeInjectionViolations": 0,
16
+ "maxStaleSelectedFiles": 0,
14
17
  "maxRetrievalCycle": 3
15
18
  },
16
19
  "queries": [
@@ -26,6 +29,65 @@
26
29
  ],
27
30
  "relevantSymbols": ["VideoPlayer"],
28
31
  "expectedEmptyMemory": true
32
+ },
33
+ {
34
+ "id": "video-player-performance-paraphrase-zh-en",
35
+ "query": "审查 src/components/video-player/VideoPlayer.tsx 的 React render 性能和调用方",
36
+ "intent": "performance",
37
+ "relevantCode": [
38
+ { "path": "src/components/video-player/VideoPlayer.tsx", "role": "target" },
39
+ { "path": "src/pages/VideoPlayerPage.tsx", "role": "caller" },
40
+ { "path": "src/components/video-player/VideoPlayer.css", "role": "resource" },
41
+ { "path": "src/routes/video-player.tsx", "role": "route" }
42
+ ],
43
+ "relevantSymbols": ["VideoPlayer"],
44
+ "expectedEmptyMemory": true,
45
+ "degradation": "reranker_unavailable"
46
+ },
47
+ {
48
+ "id": "out-of-domain-expected-empty",
49
+ "query": "explain Kubernetes ingress certificate rotation",
50
+ "intent": "understand",
51
+ "expectedEmptyMemory": true,
52
+ "expectedEmptyKnowledge": true
53
+ },
54
+ {
55
+ "id": "incompatible-version-no-substitution",
56
+ "query": "modify the React 18 useEffect API integration in src/components/video-player/VideoPlayer.tsx",
57
+ "intent": "feature",
58
+ "relevantCode": [
59
+ { "path": "src/components/video-player/VideoPlayer.tsx", "role": "target" },
60
+ { "path": "src/pages/VideoPlayerPage.tsx", "role": "caller" },
61
+ { "path": "src/components/video-player/VideoPlayer.css", "role": "resource" },
62
+ { "path": "src/routes/video-player.tsx", "role": "route" }
63
+ ],
64
+ "forbiddenKnowledgeSources": ["typescript", "browser"],
65
+ "forbiddenKnowledgeKinds": ["overview"],
66
+ "degradation": "embedding_unavailable"
67
+ },
68
+ {
69
+ "id": "create-rejects-generic-overview",
70
+ "query": "create a playback control in src/components/video-player/VideoPlayer.tsx",
71
+ "intent": "feature",
72
+ "relevantCode": [
73
+ { "path": "src/components/video-player/VideoPlayer.tsx", "role": "target" },
74
+ { "path": "src/pages/VideoPlayerPage.tsx", "role": "caller" },
75
+ { "path": "src/components/video-player/VideoPlayer.css", "role": "resource" },
76
+ { "path": "src/routes/video-player.tsx", "role": "route" }
77
+ ],
78
+ "forbiddenKnowledgeKinds": ["overview"]
79
+ },
80
+ {
81
+ "id": "stale-file-guard",
82
+ "query": "analyze the current VideoPlayer implementation in src/components/video-player/VideoPlayer.tsx",
83
+ "intent": "review",
84
+ "relevantCode": [
85
+ { "path": "src/components/video-player/VideoPlayer.tsx", "role": "target" },
86
+ { "path": "src/pages/VideoPlayerPage.tsx", "role": "caller" },
87
+ { "path": "src/components/video-player/VideoPlayer.css", "role": "resource" },
88
+ { "path": "src/routes/video-player.tsx", "role": "route" }
89
+ ],
90
+ "expectedEmptyMemory": true
29
91
  }
30
92
  ],
31
93
  "forbiddenCodeEdges": [
@@ -0,0 +1,93 @@
1
+ {
2
+ "schemaVersion": "devflow.retrieval-quality.v1",
3
+ "thresholds": {
4
+ "codeFileRecallAt5": 1,
5
+ "codeFilePrecisionAt5": 1,
6
+ "symbolNdcgAt5": 0.8,
7
+ "falseCrossFileEdgeRate": 0.01,
8
+ "memoryRecallAt5": 0.9,
9
+ "policyMemoryRecallAt5": 1,
10
+ "memoryPrecisionAt5": 0.95,
11
+ "expectedEmptyMemoryAccuracy": 1,
12
+ "knowledgeNdcgAt5": 0.85,
13
+ "knowledgePrecisionAt3": 0.8,
14
+ "knowledgeVectorCoverage": 0,
15
+ "knowledgeChunkP95": 3000,
16
+ "knowledgeVersionMatch": 1,
17
+ "maxKnowledgeInjectionViolations": 0,
18
+ "maxStaleSelectedFiles": 0,
19
+ "maxRetrievalCycle": 3,
20
+ "minPolicyActionAccuracy": 1,
21
+ "minLedgerCompleteness": 1,
22
+ "maxSameSessionMemoryReadyMs": 5000
23
+ },
24
+ "setup": {
25
+ "resetProjectState": true,
26
+ "explicitMemories": [
27
+ "In this project, format code with Prettier.",
28
+ "In this project, style components with Tailwind CSS.",
29
+ "In this project, use shadcn as the component library.",
30
+ "In this project, build components with React."
31
+ ],
32
+ "knowledgeSources": [
33
+ {
34
+ "name": "react",
35
+ "pluginName": "builtin",
36
+ "version": "18.3.0",
37
+ "chunks": [
38
+ {
39
+ "title": "React component rendering",
40
+ "content": "React components should keep render work focused. Profile component commits before changing update frequency. A Login component should use controlled form state and accessible labels.",
41
+ "sourceUrl": "https://react.dev/reference/react"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ "queries": [
48
+ {
49
+ "id": "http-expected-empty",
50
+ "query": "audit HTTP request latency and connection reuse",
51
+ "intent": "performance",
52
+ "expectedEmptyMemory": true,
53
+ "expectedEmptyKnowledge": true
54
+ },
55
+ {
56
+ "id": "project-ui-conventions",
57
+ "query": "What Prettier Tailwind and shadcn conventions apply to src/components/Login.tsx?",
58
+ "intent": "understand",
59
+ "relevantCode": [{ "path": "src/components/Login.tsx", "role": "target" }],
60
+ "relevantMemoryTerms": ["prettier", "tailwind", "shadcn"]
61
+ },
62
+ {
63
+ "id": "login-tailwind-shadcn-prettier",
64
+ "query": "create Login component in src/components/Login.tsx",
65
+ "intent": "feature",
66
+ "activeSkill": "devflow:react",
67
+ "relevantCode": [{ "path": "src/components/Login.tsx", "role": "target" }],
68
+ "relevantMemoryTerms": ["prettier", "tailwind", "shadcn", "react"],
69
+ "relevantKnowledgeSources": ["react"],
70
+ "expectedPolicyFacets": ["formatting", "styling", "component_library", "framework"],
71
+ "expectedDomainAction": "react_new_component",
72
+ "expectedVerificationKinds": ["formatter", "typecheck"]
73
+ },
74
+ {
75
+ "id": "video-performance-domain-action",
76
+ "query": "analyze rendering performance in src/components/Login.tsx",
77
+ "intent": "performance",
78
+ "activeSkill": "devflow:react",
79
+ "relevantCode": [{ "path": "src/components/Login.tsx", "role": "target" }],
80
+ "relevantKnowledgeSources": ["react"],
81
+ "expectedDomainAction": "react_audit_performance"
82
+ },
83
+ {
84
+ "id": "api-specific-knowledge-rejection",
85
+ "query": "review React 19 useEffect API hooks in src/components/Login.tsx",
86
+ "intent": "review",
87
+ "activeSkill": "devflow:react",
88
+ "relevantCode": [{ "path": "src/components/Login.tsx", "role": "target" }],
89
+ "expectedEmptyKnowledge": true,
90
+ "expectedDomainAction": "react_review_hooks"
91
+ }
92
+ ]
93
+ }
@@ -2,15 +2,18 @@
2
2
  "schemaVersion": "devflow.retrieval-quality.v1",
3
3
  "thresholds": {
4
4
  "codeFileRecallAt5": 0.85,
5
- "codeFilePrecisionAt5": 0.75,
5
+ "codeFilePrecisionAt5": 0.85,
6
6
  "symbolNdcgAt5": 0.85,
7
7
  "falseCrossFileEdgeRate": 0.01,
8
8
  "memoryPrecisionAt5": 0.8,
9
9
  "expectedEmptyMemoryAccuracy": 1,
10
10
  "knowledgeNdcgAt5": 0.85,
11
+ "knowledgePrecisionAt3": 0.8,
11
12
  "knowledgeVectorCoverage": 0.95,
12
13
  "knowledgeChunkP95": 3000,
13
- "knowledgeVersionMatch": 1
14
+ "knowledgeVersionMatch": 1,
15
+ "maxKnowledgeInjectionViolations": 0,
16
+ "maxStaleSelectedFiles": 0
14
17
  },
15
18
  "queries": [
16
19
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/benchmark",
3
- "version": "0.16.27",
3
+ "version": "0.16.29",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@colbymchenry/codegraph": "^1.1.1",
22
- "@devflow-tools/context-engine": "0.16.27",
23
- "@devflow-tools/database": "0.16.27",
24
- "@devflow-tools/sdk": "0.16.27"
22
+ "@devflow-tools/context-engine": "0.16.29",
23
+ "@devflow-tools/database": "0.16.29",
24
+ "@devflow-tools/sdk": "0.16.29"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.5.0",
@@ -31,5 +31,5 @@
31
31
  "dist",
32
32
  "fixtures"
33
33
  ],
34
- "gitHead": "964af33767bf232606e63d973b3a29d7d53c8119"
34
+ "gitHead": "7a0def7e75bdc9462308824e450f1a33e5e75b34"
35
35
  }