File tree Expand file tree Collapse file tree
packages/cli/src/commands/score Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,10 @@ export function collectMetrics({
211211 if ( allOfStats ) result = addStats ( result , allOfStats ) ;
212212 if ( polyStats ) result = addStats ( result , polyStats ) ;
213213 if ( discStats ) result = addStats ( result , discStats ) ;
214+
215+ if ( ref ) {
216+ result = { ...result , refsUsed : [ ref , ...result . refsUsed ] } ;
217+ }
214218 } else {
215219 result = walkSchemaRaw ( schemaNode , debug ) ;
216220 }
Original file line number Diff line number Diff line change @@ -31,8 +31,10 @@ export function computeOperationSubscores(
3131 const descTotal = 1 + metrics . parameterCount + metrics . totalSchemaProperties ;
3232 const documentationQuality = descTotal > 0 ? clamp01 ( descCount / descTotal ) : 1 ;
3333
34- const propCount = metrics . totalSchemaProperties || 1 ;
35- const constraintClarity = clamp01 ( metrics . constraintCount / propCount ) ;
34+ const constraintClarity =
35+ metrics . totalSchemaProperties > 0
36+ ? clamp01 ( metrics . constraintCount / metrics . totalSchemaProperties )
37+ : 1 ;
3638
3739 const examplePoints =
3840 ( metrics . requestExamplePresent ? 1 : 0 ) + ( metrics . responseExamplePresent ? 1 : 0 ) ;
Original file line number Diff line number Diff line change 55 "parameterSimplicity": 0.8625,
66 "schemaSimplicity": 0.796875,
77 "documentationQuality": 0.9017857142857143,
8- "constraintClarity": 0.4375 ,
8+ "constraintClarity": 0.5625 ,
99 "exampleCoverage": 0.875,
1010 "errorClarity": 1,
1111 "dependencyClarity": 0.7291666666666669,
309309 }
310310 },
311311 "getTicketCode": {
312- "agentReadiness": 69 ,
312+ "agentReadiness": 81 ,
313313 "subscores": {
314314 "parameterSimplicity": 0.9,
315315 "schemaSimplicity": 1,
316316 "documentationQuality": 1,
317- "constraintClarity": 0 ,
317+ "constraintClarity": 1 ,
318318 "exampleCoverage": 0,
319319 "errorClarity": 1,
320320 "dependencyClarity": 1,
338338 "path": "/tickets/{ticketId}/qr",
339339 "method": "get",
340340 "operationId": "getTicketCode",
341- "agentReadinessScore": 69 ,
341+ "agentReadinessScore": 81 ,
342342 "reasons": [
343343 "Missing response examples"
344344 ]
Original file line number Diff line number Diff line change 88 Parameter Simplicity [█████████████████░░░] 86%
99 Schema Simplicity [████████████████░░░░] 80%
1010 Documentation Quality [██████████████████░░] 90%
11- Constraint Clarity [█████████░░░░░░░░░░░] 44 %
11+ Constraint Clarity [███████████ ░░░░░░░░░] 56 %
1212 Example Coverage [██████████████████░░] 88%
1313 Error Clarity [████████████████████] 100%
1414 Dependency Clarity [███████████████░░░░░] 73%
3030 Top 1 Hotspot Operations
3131
3232 GET /tickets/{ticketId}/qr (getTicketCode)
33- Agent Readiness: 69 .0
33+ Agent Readiness: 81 .0
3434 - Missing response examples
3535
3636
You can’t perform that action at this time.
0 commit comments