@supermodeltools/openapi-spec 0.9.3 → 0.9.4

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 (2) hide show
  1. package/openapi.yaml +1208 -1
  2. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.0.0
2
2
  info:
3
3
  title: Supermodel
4
4
  description: Code Graphing & Analysis API
5
- version: 0.9.3
5
+ version: 0.9.4
6
6
  license:
7
7
  name: Supermodel API Terms of Service
8
8
  url: https://supermodeltools.com/legal/api-terms
@@ -1603,6 +1603,479 @@ paths:
1603
1603
  application/json:
1604
1604
  schema:
1605
1605
  $ref: '#/components/schemas/Error'
1606
+ /v1/analysis/test-coverage-map:
1607
+ post:
1608
+ tags:
1609
+ - Data Plane
1610
+ summary: Test coverage map
1611
+ description: Upload a zipped repository snapshot to identify functions with zero test coverage by tracing call graph reachability from test files to production code. This is static analysis — no test execution or instrumentation required.
1612
+ operationId: generateTestCoverageMap
1613
+ security:
1614
+ - ApiKeyAuth: []
1615
+ parameters:
1616
+ - $ref: '#/components/parameters/IdempotencyKey'
1617
+ requestBody:
1618
+ required: true
1619
+ content:
1620
+ multipart/form-data:
1621
+ schema:
1622
+ type: object
1623
+ required:
1624
+ - file
1625
+ properties:
1626
+ file:
1627
+ type: string
1628
+ format: binary
1629
+ description: Zipped repository archive containing the code to analyze.
1630
+ x-codeSamples:
1631
+ - lang: cURL
1632
+ label: cURL
1633
+ source: |
1634
+ curl -X POST 'https://api.supermodeltools.com/v1/analysis/test-coverage-map' \
1635
+ -H 'Idempotency-Key: <idempotency-key>' \
1636
+ -H 'X-Api-Key: <api-key>' \
1637
+ -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
1638
+ responses:
1639
+ '200':
1640
+ description: Test coverage map (job completed)
1641
+ headers:
1642
+ X-Request-Id:
1643
+ $ref: '#/components/headers/X-Request-Id'
1644
+ X-API-Version:
1645
+ $ref: '#/components/headers/X-API-Version'
1646
+ RateLimit-Limit:
1647
+ $ref: '#/components/headers/RateLimit-Limit'
1648
+ RateLimit-Remaining:
1649
+ $ref: '#/components/headers/RateLimit-Remaining'
1650
+ RateLimit-Reset:
1651
+ $ref: '#/components/headers/RateLimit-Reset'
1652
+ X-Usage-Units:
1653
+ $ref: '#/components/headers/X-Usage-Units'
1654
+ content:
1655
+ application/json:
1656
+ schema:
1657
+ $ref: '#/components/schemas/TestCoverageMapResponseAsync'
1658
+ example:
1659
+ status: completed
1660
+ jobId: abc-123-def
1661
+ result:
1662
+ metadata:
1663
+ totalFiles: 142
1664
+ testFiles: 28
1665
+ productionFiles: 114
1666
+ totalFunctions: 891
1667
+ testedFunctions: 342
1668
+ untestedFunctions: 549
1669
+ coveragePercentage: 38.4
1670
+ analysisMethod: static_call_graph_test_reachability
1671
+ analysisStartTime: '2026-02-09T12:00:00Z'
1672
+ analysisEndTime: '2026-02-09T12:01:00Z'
1673
+ untestedFunctions:
1674
+ - file: src/services/billing.ts
1675
+ name: calculateRefund
1676
+ line: 89
1677
+ type: function
1678
+ confidence: high
1679
+ reason: No test file calls this function directly or transitively
1680
+ testedFunctions:
1681
+ - file: src/services/billing.ts
1682
+ name: calculateTotal
1683
+ line: 45
1684
+ type: function
1685
+ testFiles:
1686
+ - tests/billing.test.ts
1687
+ directTestCallers: 3
1688
+ transitiveTestCallers: 7
1689
+ testFiles:
1690
+ - file: tests/billing.test.ts
1691
+ testFunctions: 12
1692
+ productionFunctionsCovered: 8
1693
+ productionFilesCovered: 3
1694
+ coverageByFile:
1695
+ - file: src/services/billing.ts
1696
+ totalFunctions: 12
1697
+ testedFunctions: 8
1698
+ untestedFunctions: 4
1699
+ coveragePercentage: 66.7
1700
+ '202':
1701
+ description: Job accepted and processing
1702
+ headers:
1703
+ X-Request-Id:
1704
+ $ref: '#/components/headers/X-Request-Id'
1705
+ X-API-Version:
1706
+ $ref: '#/components/headers/X-API-Version'
1707
+ Retry-After:
1708
+ description: Recommended wait time in seconds before polling again.
1709
+ schema:
1710
+ type: integer
1711
+ content:
1712
+ application/json:
1713
+ schema:
1714
+ $ref: '#/components/schemas/TestCoverageMapResponseAsync'
1715
+ example:
1716
+ status: processing
1717
+ jobId: abc-123-def
1718
+ retryAfter: 5
1719
+ '400':
1720
+ $ref: '#/components/responses/BadRequest'
1721
+ '401':
1722
+ $ref: '#/components/responses/Unauthorized'
1723
+ '403':
1724
+ $ref: '#/components/responses/Forbidden'
1725
+ '429':
1726
+ $ref: '#/components/responses/TooManyRequests'
1727
+ '500':
1728
+ $ref: '#/components/responses/InternalError'
1729
+ '502':
1730
+ description: Bad Gateway
1731
+ content:
1732
+ application/json:
1733
+ schema:
1734
+ $ref: '#/components/schemas/Error'
1735
+ /v1/analysis/circular-dependencies:
1736
+ post:
1737
+ tags:
1738
+ - Data Plane
1739
+ summary: Circular dependency detection
1740
+ description: Upload a zipped repository snapshot to detect circular dependencies (dependency cycles) at the file level using Tarjan's strongly connected components algorithm.
1741
+ operationId: generateCircularDependencyAnalysis
1742
+ security:
1743
+ - ApiKeyAuth: []
1744
+ parameters:
1745
+ - $ref: '#/components/parameters/IdempotencyKey'
1746
+ requestBody:
1747
+ required: true
1748
+ content:
1749
+ multipart/form-data:
1750
+ schema:
1751
+ type: object
1752
+ required:
1753
+ - file
1754
+ properties:
1755
+ file:
1756
+ type: string
1757
+ format: binary
1758
+ description: Zipped repository archive containing the code to analyze.
1759
+ x-codeSamples:
1760
+ - lang: cURL
1761
+ label: cURL
1762
+ source: |
1763
+ curl -X POST 'https://api.supermodeltools.com/v1/analysis/circular-dependencies' \
1764
+ -H 'Idempotency-Key: <idempotency-key>' \
1765
+ -H 'X-Api-Key: <api-key>' \
1766
+ -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
1767
+ responses:
1768
+ '200':
1769
+ description: Circular dependency analysis (job completed)
1770
+ headers:
1771
+ X-Request-Id:
1772
+ $ref: '#/components/headers/X-Request-Id'
1773
+ X-API-Version:
1774
+ $ref: '#/components/headers/X-API-Version'
1775
+ RateLimit-Limit:
1776
+ $ref: '#/components/headers/RateLimit-Limit'
1777
+ RateLimit-Remaining:
1778
+ $ref: '#/components/headers/RateLimit-Remaining'
1779
+ RateLimit-Reset:
1780
+ $ref: '#/components/headers/RateLimit-Reset'
1781
+ X-Usage-Units:
1782
+ $ref: '#/components/headers/X-Usage-Units'
1783
+ content:
1784
+ application/json:
1785
+ schema:
1786
+ $ref: '#/components/schemas/CircularDependencyResponseAsync'
1787
+ example:
1788
+ status: completed
1789
+ jobId: abc-123-def
1790
+ result:
1791
+ metadata:
1792
+ totalFiles: 142
1793
+ totalImports: 487
1794
+ cycleCount: 7
1795
+ analysisMethod: tarjan_scc
1796
+ analysisStartTime: '2026-02-09T12:00:00Z'
1797
+ analysisEndTime: '2026-02-09T12:00:05Z'
1798
+ cycles:
1799
+ - id: cycle-1
1800
+ severity: high
1801
+ files:
1802
+ - src/services/billingService.ts
1803
+ - src/services/orderService.ts
1804
+ - src/services/userService.ts
1805
+ edges:
1806
+ - source: src/services/userService.ts
1807
+ target: src/services/orderService.ts
1808
+ importedSymbols:
1809
+ - getOrders
1810
+ - OrderStatus
1811
+ - source: src/services/orderService.ts
1812
+ target: src/services/billingService.ts
1813
+ importedSymbols:
1814
+ - calculateTotal
1815
+ - source: src/services/billingService.ts
1816
+ target: src/services/userService.ts
1817
+ importedSymbols:
1818
+ - getUserDiscount
1819
+ breakingSuggestion: src/services/billingService.ts -> src/services/userService.ts
1820
+ summary:
1821
+ totalCycles: 7
1822
+ filesInCycles: 18
1823
+ highSeverityCount: 2
1824
+ mediumSeverityCount: 3
1825
+ lowSeverityCount: 2
1826
+ '202':
1827
+ description: Job accepted and processing
1828
+ headers:
1829
+ X-Request-Id:
1830
+ $ref: '#/components/headers/X-Request-Id'
1831
+ X-API-Version:
1832
+ $ref: '#/components/headers/X-API-Version'
1833
+ Retry-After:
1834
+ description: Recommended wait time in seconds before polling again.
1835
+ schema:
1836
+ type: integer
1837
+ content:
1838
+ application/json:
1839
+ schema:
1840
+ $ref: '#/components/schemas/CircularDependencyResponseAsync'
1841
+ example:
1842
+ status: processing
1843
+ jobId: abc-123-def
1844
+ retryAfter: 5
1845
+ '400':
1846
+ $ref: '#/components/responses/BadRequest'
1847
+ '401':
1848
+ $ref: '#/components/responses/Unauthorized'
1849
+ '403':
1850
+ $ref: '#/components/responses/Forbidden'
1851
+ '429':
1852
+ $ref: '#/components/responses/TooManyRequests'
1853
+ '500':
1854
+ $ref: '#/components/responses/InternalError'
1855
+ '502':
1856
+ description: Bad Gateway
1857
+ content:
1858
+ application/json:
1859
+ schema:
1860
+ $ref: '#/components/schemas/Error'
1861
+ /v1/analysis/impact:
1862
+ post:
1863
+ tags:
1864
+ - Data Plane
1865
+ summary: Impact analysis
1866
+ description: |-
1867
+ Compute blast radius — what breaks if a given file or function changes. Uses reverse-reachability BFS on call graph and dependency graph, enriched with LLM-powered domain classification to detect cross-domain impact.
1868
+
1869
+ **Three usage modes:**
1870
+ 1. **With diff** — upload a unified diff (`git diff` output) alongside the repo zip.
1871
+ Changed files are automatically extracted as targets. Best for CI/CD pipelines.
1872
+
1873
+ 2. **With targets** — specify files or file:function pairs via query parameter.
1874
+ Best for ad-hoc analysis of specific functions.
1875
+
1876
+ 3. **Neither** — analyzes the entire codebase and returns a global coupling/risk map
1877
+ with the most critical files ranked by dependent count.
1878
+
1879
+
1880
+ **CI Integration (GitHub Actions):**
1881
+ ```yaml - name: Impact Analysis
1882
+ run: |
1883
+ git diff origin/main...HEAD > changes.diff
1884
+ git archive --format=zip HEAD -o repo.zip
1885
+ curl -s -X POST "$SUPERMODEL_API_URL/v1/analysis/impact" \
1886
+ -H "Idempotency-Key: ${{ github.run_id }}-impact" \
1887
+ -H "X-Api-Key: ${{ secrets.SUPERMODEL_API_KEY }}" \
1888
+ -F "file=@repo.zip;type=application/zip" \
1889
+ -F "diff=@changes.diff;type=text/plain" \
1890
+ -o impact.json
1891
+ ```
1892
+
1893
+ **CI Integration (GitLab CI):**
1894
+ ```yaml impact_analysis:
1895
+ script:
1896
+ - git diff origin/main...HEAD > changes.diff
1897
+ - git archive --format=zip HEAD -o repo.zip
1898
+ - >-
1899
+ curl -s -X POST "$SUPERMODEL_API_URL/v1/analysis/impact"
1900
+ -H "Idempotency-Key: $CI_PIPELINE_IID-impact"
1901
+ -H "X-Api-Key: $SUPERMODEL_API_KEY"
1902
+ -F "file=@repo.zip;type=application/zip"
1903
+ -F "diff=@changes.diff;type=text/plain"
1904
+ -o impact.json
1905
+ ```
1906
+
1907
+ **Standalone usage (no CI):**
1908
+ ```bash # Analyze specific targets curl -X POST '.../v1/analysis/impact?targets=src/services/billing.ts:calculateTotal' \
1909
+ -H 'Idempotency-Key: my-key' -H 'X-Api-Key: ...' \
1910
+ -F 'file=@repo.zip;type=application/zip'
1911
+
1912
+ # Analyze from a diff git diff main > changes.diff && git archive --format=zip HEAD -o repo.zip curl -X POST '.../v1/analysis/impact' \
1913
+ -H 'Idempotency-Key: my-key' -H 'X-Api-Key: ...' \
1914
+ -F 'file=@repo.zip;type=application/zip' \
1915
+ -F 'diff=@changes.diff;type=text/plain'
1916
+
1917
+ # Global coupling map (no targets, no diff) curl -X POST '.../v1/analysis/impact' \
1918
+ -H 'Idempotency-Key: my-key' -H 'X-Api-Key: ...' \
1919
+ -F 'file=@repo.zip;type=application/zip'
1920
+ ```
1921
+ operationId: generateImpactAnalysis
1922
+ security:
1923
+ - ApiKeyAuth: []
1924
+ parameters:
1925
+ - $ref: '#/components/parameters/IdempotencyKey'
1926
+ - name: targets
1927
+ in: query
1928
+ required: false
1929
+ schema:
1930
+ type: string
1931
+ description: 'Comma-separated list of file paths or file:functionName pairs to analyze. If omitted, analyzes all files and returns a global coupling/risk map. Examples: ''src/services/billing.ts'', ''src/services/billing.ts:calculateTotal,src/auth/login.ts''.'
1932
+ requestBody:
1933
+ required: true
1934
+ content:
1935
+ multipart/form-data:
1936
+ schema:
1937
+ type: object
1938
+ required:
1939
+ - file
1940
+ properties:
1941
+ file:
1942
+ type: string
1943
+ format: binary
1944
+ description: Zipped repository archive containing the code to analyze.
1945
+ diff:
1946
+ type: string
1947
+ format: binary
1948
+ description: Optional unified diff (output of `git diff`). When provided, changed files are automatically extracted and used as analysis targets. This is the recommended input for CI/CD pipelines. If both `diff` and `targets` are provided, the targets from both are merged.
1949
+ x-codeSamples:
1950
+ - lang: cURL
1951
+ label: With diff (CI)
1952
+ source: |
1953
+ git diff origin/main...HEAD > changes.diff
1954
+ git archive --format=zip HEAD -o repo.zip
1955
+ curl -X POST 'https://api.supermodeltools.com/v1/analysis/impact' \
1956
+ -H 'Idempotency-Key: <idempotency-key>' \
1957
+ -H 'X-Api-Key: <api-key>' \
1958
+ -F 'file=@repo.zip;type=application/zip' \
1959
+ -F 'diff=@changes.diff;type=text/plain'
1960
+ - lang: cURL
1961
+ label: With targets
1962
+ source: |
1963
+ curl -X POST 'https://api.supermodeltools.com/v1/analysis/impact?targets=src/services/billing.ts' \
1964
+ -H 'Idempotency-Key: <idempotency-key>' \
1965
+ -H 'X-Api-Key: <api-key>' \
1966
+ -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
1967
+ responses:
1968
+ '200':
1969
+ description: Impact analysis (job completed)
1970
+ headers:
1971
+ X-Request-Id:
1972
+ $ref: '#/components/headers/X-Request-Id'
1973
+ X-API-Version:
1974
+ $ref: '#/components/headers/X-API-Version'
1975
+ RateLimit-Limit:
1976
+ $ref: '#/components/headers/RateLimit-Limit'
1977
+ RateLimit-Remaining:
1978
+ $ref: '#/components/headers/RateLimit-Remaining'
1979
+ RateLimit-Reset:
1980
+ $ref: '#/components/headers/RateLimit-Reset'
1981
+ X-Usage-Units:
1982
+ $ref: '#/components/headers/X-Usage-Units'
1983
+ content:
1984
+ application/json:
1985
+ schema:
1986
+ $ref: '#/components/schemas/ImpactAnalysisResponseAsync'
1987
+ example:
1988
+ status: completed
1989
+ jobId: abc-123-def
1990
+ result:
1991
+ metadata:
1992
+ totalFiles: 142
1993
+ totalFunctions: 891
1994
+ targetsAnalyzed: 1
1995
+ analysisMethod: reverse_reachability_call_graph
1996
+ analysisStartTime: '2026-02-09T12:00:00Z'
1997
+ analysisEndTime: '2026-02-09T12:00:45Z'
1998
+ impacts:
1999
+ - target:
2000
+ file: src/services/billing.ts
2001
+ name: calculateTotal
2002
+ line: 45
2003
+ type: function
2004
+ blastRadius:
2005
+ directDependents: 8
2006
+ transitiveDependents: 31
2007
+ affectedFiles: 12
2008
+ affectedDomains:
2009
+ - Billing
2010
+ - Checkout
2011
+ - Notifications
2012
+ riskScore: high
2013
+ riskFactors:
2014
+ - High fan-in (8 direct callers)
2015
+ - Deep dependency chain (5 levels)
2016
+ - Crosses 3 domain boundaries
2017
+ affectedFunctions:
2018
+ - file: src/handlers/checkout.ts
2019
+ name: processCheckout
2020
+ line: 12
2021
+ type: function
2022
+ distance: 1
2023
+ relationship: direct_caller
2024
+ affectedFiles:
2025
+ - file: src/handlers/checkout.ts
2026
+ directDependencies: 3
2027
+ transitiveDependencies: 7
2028
+ entryPointsAffected:
2029
+ - file: src/routes/checkout.ts
2030
+ name: POST /checkout
2031
+ type: route_handler
2032
+ globalMetrics:
2033
+ mostCriticalFiles:
2034
+ - file: src/services/billing.ts
2035
+ dependentCount: 31
2036
+ riskScore: high
2037
+ crossDomainDependencies:
2038
+ - from: Billing
2039
+ to: Checkout
2040
+ edgeCount: 5
2041
+ - from: Billing
2042
+ to: Notifications
2043
+ edgeCount: 2
2044
+ '202':
2045
+ description: Job accepted and processing
2046
+ headers:
2047
+ X-Request-Id:
2048
+ $ref: '#/components/headers/X-Request-Id'
2049
+ X-API-Version:
2050
+ $ref: '#/components/headers/X-API-Version'
2051
+ Retry-After:
2052
+ description: Recommended wait time in seconds before polling again.
2053
+ schema:
2054
+ type: integer
2055
+ content:
2056
+ application/json:
2057
+ schema:
2058
+ $ref: '#/components/schemas/ImpactAnalysisResponseAsync'
2059
+ example:
2060
+ status: processing
2061
+ jobId: abc-123-def
2062
+ retryAfter: 10
2063
+ '400':
2064
+ $ref: '#/components/responses/BadRequest'
2065
+ '401':
2066
+ $ref: '#/components/responses/Unauthorized'
2067
+ '403':
2068
+ $ref: '#/components/responses/Forbidden'
2069
+ '429':
2070
+ $ref: '#/components/responses/TooManyRequests'
2071
+ '500':
2072
+ $ref: '#/components/responses/InternalError'
2073
+ '502':
2074
+ description: Bad Gateway
2075
+ content:
2076
+ application/json:
2077
+ schema:
2078
+ $ref: '#/components/schemas/Error'
1606
2079
  components:
1607
2080
  securitySchemes:
1608
2081
  ApiKeyAuth:
@@ -1983,6 +2456,308 @@ components:
1983
2456
  result:
1984
2457
  $ref: '#/components/schemas/DeadCodeAnalysisResponse'
1985
2458
  description: The result (present when status is completed).
2459
+ TestCoverageMapResponseAsync:
2460
+ allOf:
2461
+ - $ref: '#/components/schemas/JobStatus'
2462
+ - type: object
2463
+ description: Async response envelope for test coverage map operations.
2464
+ properties:
2465
+ result:
2466
+ $ref: '#/components/schemas/TestCoverageMapResponse'
2467
+ description: The result (present when status is completed).
2468
+ CircularDependencyResponseAsync:
2469
+ allOf:
2470
+ - $ref: '#/components/schemas/JobStatus'
2471
+ - type: object
2472
+ description: Async response envelope for circular dependency analysis operations.
2473
+ properties:
2474
+ result:
2475
+ $ref: '#/components/schemas/CircularDependencyResponse'
2476
+ description: The result (present when status is completed).
2477
+ ImpactAnalysisResponseAsync:
2478
+ allOf:
2479
+ - $ref: '#/components/schemas/JobStatus'
2480
+ - type: object
2481
+ description: Async response envelope for impact analysis operations.
2482
+ properties:
2483
+ result:
2484
+ $ref: '#/components/schemas/ImpactAnalysisResponse'
2485
+ description: The result (present when status is completed).
2486
+ ImpactAnalysisResponse:
2487
+ type: object
2488
+ description: Impact analysis result containing blast radius and affected functions/files.
2489
+ required:
2490
+ - metadata
2491
+ - impacts
2492
+ - globalMetrics
2493
+ properties:
2494
+ metadata:
2495
+ $ref: '#/components/schemas/ImpactAnalysisMetadata'
2496
+ impacts:
2497
+ type: array
2498
+ description: Impact results for each analyzed target.
2499
+ items:
2500
+ $ref: '#/components/schemas/ImpactResult'
2501
+ globalMetrics:
2502
+ $ref: '#/components/schemas/ImpactGlobalMetrics'
2503
+ ImpactAnalysisMetadata:
2504
+ type: object
2505
+ description: Summary statistics for the impact analysis.
2506
+ required:
2507
+ - totalFiles
2508
+ - totalFunctions
2509
+ - targetsAnalyzed
2510
+ - analysisMethod
2511
+ properties:
2512
+ totalFiles:
2513
+ type: integer
2514
+ format: int64
2515
+ description: Total number of files in the repository.
2516
+ totalFunctions:
2517
+ type: integer
2518
+ format: int64
2519
+ description: Total number of functions analyzed.
2520
+ targetsAnalyzed:
2521
+ type: integer
2522
+ format: int32
2523
+ description: Number of targets analyzed.
2524
+ analysisMethod:
2525
+ type: string
2526
+ description: Method used for impact analysis.
2527
+ analysisStartTime:
2528
+ type: string
2529
+ format: date-time
2530
+ description: Timestamp when analysis started.
2531
+ analysisEndTime:
2532
+ type: string
2533
+ format: date-time
2534
+ description: Timestamp when analysis completed.
2535
+ ImpactResult:
2536
+ type: object
2537
+ description: Impact analysis result for a single target.
2538
+ required:
2539
+ - target
2540
+ - blastRadius
2541
+ - affectedFunctions
2542
+ - affectedFiles
2543
+ - entryPointsAffected
2544
+ properties:
2545
+ target:
2546
+ $ref: '#/components/schemas/ImpactTarget'
2547
+ blastRadius:
2548
+ $ref: '#/components/schemas/BlastRadius'
2549
+ affectedFunctions:
2550
+ type: array
2551
+ description: Functions affected by changes to this target.
2552
+ items:
2553
+ $ref: '#/components/schemas/AffectedFunction'
2554
+ affectedFiles:
2555
+ type: array
2556
+ description: Files affected by changes to this target.
2557
+ items:
2558
+ $ref: '#/components/schemas/AffectedFile'
2559
+ entryPointsAffected:
2560
+ type: array
2561
+ description: Entry points (route handlers, exports) affected by this target.
2562
+ items:
2563
+ $ref: '#/components/schemas/AffectedEntryPoint'
2564
+ ImpactTarget:
2565
+ type: object
2566
+ description: The target file or function being analyzed for impact.
2567
+ required:
2568
+ - file
2569
+ - type
2570
+ properties:
2571
+ file:
2572
+ type: string
2573
+ description: File path relative to repository root.
2574
+ name:
2575
+ type: string
2576
+ description: Function or method name (if targeting a specific function).
2577
+ line:
2578
+ type: integer
2579
+ format: int32
2580
+ description: Line number of the target declaration.
2581
+ type:
2582
+ type: string
2583
+ description: Type of the target element.
2584
+ enum:
2585
+ - file
2586
+ - function
2587
+ - method
2588
+ - class
2589
+ BlastRadius:
2590
+ type: object
2591
+ description: Blast radius metrics for a target.
2592
+ required:
2593
+ - directDependents
2594
+ - transitiveDependents
2595
+ - affectedFiles
2596
+ - riskScore
2597
+ properties:
2598
+ directDependents:
2599
+ type: integer
2600
+ format: int32
2601
+ description: Number of direct callers/dependents.
2602
+ transitiveDependents:
2603
+ type: integer
2604
+ format: int32
2605
+ description: Number of transitive (indirect) dependents.
2606
+ affectedFiles:
2607
+ type: integer
2608
+ format: int32
2609
+ description: Number of files affected.
2610
+ affectedDomains:
2611
+ type: array
2612
+ description: Domains affected by this change (scaffolded, empty in v1).
2613
+ items:
2614
+ type: string
2615
+ riskScore:
2616
+ type: string
2617
+ description: Risk level based on blast radius analysis.
2618
+ enum:
2619
+ - low
2620
+ - medium
2621
+ - high
2622
+ - critical
2623
+ riskFactors:
2624
+ type: array
2625
+ description: Human-readable explanations for the risk score.
2626
+ items:
2627
+ type: string
2628
+ AffectedFunction:
2629
+ type: object
2630
+ description: A function affected by changes to the target.
2631
+ required:
2632
+ - file
2633
+ - name
2634
+ - type
2635
+ - distance
2636
+ - relationship
2637
+ properties:
2638
+ file:
2639
+ type: string
2640
+ description: File path relative to repository root.
2641
+ name:
2642
+ type: string
2643
+ description: Name of the affected function.
2644
+ line:
2645
+ type: integer
2646
+ format: int32
2647
+ description: Line number of the function declaration.
2648
+ type:
2649
+ type: string
2650
+ description: Type of code element.
2651
+ enum:
2652
+ - function
2653
+ - method
2654
+ - class
2655
+ distance:
2656
+ type: integer
2657
+ format: int32
2658
+ description: Number of hops from the target in the call graph.
2659
+ relationship:
2660
+ type: string
2661
+ description: Relationship type to the target.
2662
+ enum:
2663
+ - direct_caller
2664
+ - transitive_caller
2665
+ AffectedFile:
2666
+ type: object
2667
+ description: A file affected by changes to the target.
2668
+ required:
2669
+ - file
2670
+ - directDependencies
2671
+ - transitiveDependencies
2672
+ properties:
2673
+ file:
2674
+ type: string
2675
+ description: File path relative to repository root.
2676
+ directDependencies:
2677
+ type: integer
2678
+ format: int32
2679
+ description: Number of direct dependencies in this file.
2680
+ transitiveDependencies:
2681
+ type: integer
2682
+ format: int32
2683
+ description: Number of transitive dependencies in this file.
2684
+ AffectedEntryPoint:
2685
+ type: object
2686
+ description: An entry point affected by changes to the target.
2687
+ required:
2688
+ - file
2689
+ - name
2690
+ - type
2691
+ properties:
2692
+ file:
2693
+ type: string
2694
+ description: File path relative to repository root.
2695
+ name:
2696
+ type: string
2697
+ description: Name or route of the entry point.
2698
+ type:
2699
+ type: string
2700
+ description: Type of entry point.
2701
+ enum:
2702
+ - route_handler
2703
+ - module_export
2704
+ - main_function
2705
+ - event_handler
2706
+ ImpactGlobalMetrics:
2707
+ type: object
2708
+ description: Global metrics across all analyzed targets.
2709
+ properties:
2710
+ mostCriticalFiles:
2711
+ type: array
2712
+ description: Files with the highest dependent counts.
2713
+ items:
2714
+ $ref: '#/components/schemas/CriticalFile'
2715
+ crossDomainDependencies:
2716
+ type: array
2717
+ description: Dependencies that cross domain boundaries (scaffolded, empty in v1).
2718
+ items:
2719
+ $ref: '#/components/schemas/CrossDomainDependency'
2720
+ CriticalFile:
2721
+ type: object
2722
+ description: A file identified as critical due to high dependent count.
2723
+ required:
2724
+ - file
2725
+ - dependentCount
2726
+ - riskScore
2727
+ properties:
2728
+ file:
2729
+ type: string
2730
+ description: File path relative to repository root.
2731
+ dependentCount:
2732
+ type: integer
2733
+ format: int32
2734
+ description: Total number of transitive dependents.
2735
+ riskScore:
2736
+ type: string
2737
+ description: Risk level based on dependent count.
2738
+ enum:
2739
+ - low
2740
+ - medium
2741
+ - high
2742
+ - critical
2743
+ CrossDomainDependency:
2744
+ type: object
2745
+ description: A dependency that crosses domain boundaries.
2746
+ required:
2747
+ - from
2748
+ - to
2749
+ - edgeCount
2750
+ properties:
2751
+ from:
2752
+ type: string
2753
+ description: Source domain.
2754
+ to:
2755
+ type: string
2756
+ description: Target domain.
2757
+ edgeCount:
2758
+ type: integer
2759
+ format: int32
2760
+ description: Number of cross-domain edges.
1986
2761
  DeadCodeAnalysisResponse:
1987
2762
  type: object
1988
2763
  description: Dead code analysis result containing candidates and alive code.
@@ -2164,6 +2939,438 @@ components:
2164
2939
  reason:
2165
2940
  type: string
2166
2941
  description: Reason this is considered an entry point (e.g., 'Module export', 'Route handler', 'Main function').
2942
+ TestCoverageMapResponse:
2943
+ type: object
2944
+ description: Test coverage map result identifying tested and untested functions via static call graph reachability from test files.
2945
+ required:
2946
+ - metadata
2947
+ - untestedFunctions
2948
+ - testedFunctions
2949
+ - testFiles
2950
+ - coverageByFile
2951
+ properties:
2952
+ metadata:
2953
+ $ref: '#/components/schemas/TestCoverageMapMetadata'
2954
+ untestedFunctions:
2955
+ type: array
2956
+ description: Production functions with no test coverage (not reachable from any test function).
2957
+ items:
2958
+ $ref: '#/components/schemas/UntestedFunction'
2959
+ testedFunctions:
2960
+ type: array
2961
+ description: Production functions with test coverage (reachable from at least one test function).
2962
+ items:
2963
+ $ref: '#/components/schemas/TestedFunction'
2964
+ testFiles:
2965
+ type: array
2966
+ description: Detected test files with coverage statistics.
2967
+ items:
2968
+ $ref: '#/components/schemas/TestFileInfo'
2969
+ coverageByDomain:
2970
+ type: array
2971
+ description: Coverage breakdown by domain classification.
2972
+ items:
2973
+ $ref: '#/components/schemas/CoverageByDomain'
2974
+ coverageByFile:
2975
+ type: array
2976
+ description: Coverage breakdown by production file.
2977
+ items:
2978
+ $ref: '#/components/schemas/CoverageByFile'
2979
+ TestCoverageMapMetadata:
2980
+ type: object
2981
+ description: Summary statistics for the test coverage map analysis.
2982
+ required:
2983
+ - totalFiles
2984
+ - testFiles
2985
+ - productionFiles
2986
+ - totalFunctions
2987
+ - testedFunctions
2988
+ - untestedFunctions
2989
+ - coveragePercentage
2990
+ - analysisMethod
2991
+ properties:
2992
+ totalFiles:
2993
+ type: integer
2994
+ format: int64
2995
+ description: Total number of files in the repository.
2996
+ testFiles:
2997
+ type: integer
2998
+ format: int64
2999
+ description: Number of files identified as test files.
3000
+ productionFiles:
3001
+ type: integer
3002
+ format: int64
3003
+ description: Number of non-test (production) files.
3004
+ totalFunctions:
3005
+ type: integer
3006
+ format: int64
3007
+ description: Total number of functions in production files.
3008
+ testedFunctions:
3009
+ type: integer
3010
+ format: int64
3011
+ description: Number of production functions reachable from test functions.
3012
+ untestedFunctions:
3013
+ type: integer
3014
+ format: int64
3015
+ description: Number of production functions not reachable from any test function.
3016
+ coveragePercentage:
3017
+ type: number
3018
+ format: double
3019
+ description: Percentage of production functions with test coverage.
3020
+ analysisMethod:
3021
+ type: string
3022
+ description: Method used for analysis.
3023
+ analysisStartTime:
3024
+ type: string
3025
+ format: date-time
3026
+ description: Timestamp when analysis started.
3027
+ analysisEndTime:
3028
+ type: string
3029
+ format: date-time
3030
+ description: Timestamp when analysis completed.
3031
+ UntestedFunction:
3032
+ type: object
3033
+ description: A production function with no test coverage.
3034
+ required:
3035
+ - file
3036
+ - name
3037
+ - line
3038
+ - type
3039
+ - confidence
3040
+ - reason
3041
+ properties:
3042
+ file:
3043
+ type: string
3044
+ description: File path relative to repository root.
3045
+ name:
3046
+ type: string
3047
+ description: Name of the function or method.
3048
+ line:
3049
+ type: integer
3050
+ format: int32
3051
+ description: Line number where the function is declared.
3052
+ type:
3053
+ type: string
3054
+ description: Type of code element.
3055
+ enum:
3056
+ - function
3057
+ - class
3058
+ - method
3059
+ - interface
3060
+ - type
3061
+ - variable
3062
+ - constant
3063
+ confidence:
3064
+ type: string
3065
+ description: Confidence level of the untested classification.
3066
+ enum:
3067
+ - high
3068
+ - medium
3069
+ - low
3070
+ reason:
3071
+ type: string
3072
+ description: Explanation of why this function is classified as untested.
3073
+ nearestTestedCaller:
3074
+ $ref: '#/components/schemas/NearestTestedCaller'
3075
+ suggestedTestFile:
3076
+ type: string
3077
+ description: The test file that covers the most sibling functions in the same production file. This is the recommended file in which to add a test for this untested function.
3078
+ testedSiblings:
3079
+ type: array
3080
+ description: Other functions in the same file that ARE tested, along with which test files cover them. Use this to see existing test patterns you can follow.
3081
+ items:
3082
+ $ref: '#/components/schemas/TestedSibling'
3083
+ TestedSibling:
3084
+ type: object
3085
+ description: A sibling function in the same file that has test coverage.
3086
+ required:
3087
+ - name
3088
+ - line
3089
+ - testFiles
3090
+ properties:
3091
+ name:
3092
+ type: string
3093
+ description: Name of the tested sibling function.
3094
+ line:
3095
+ type: integer
3096
+ format: int32
3097
+ description: Line number where the sibling function is declared.
3098
+ testFiles:
3099
+ type: array
3100
+ description: Test files that cover this sibling function.
3101
+ items:
3102
+ type: string
3103
+ NearestTestedCaller:
3104
+ type: object
3105
+ description: The nearest function in the call graph that has test coverage.
3106
+ required:
3107
+ - file
3108
+ - name
3109
+ - distance
3110
+ properties:
3111
+ file:
3112
+ type: string
3113
+ description: File path of the nearest tested function.
3114
+ name:
3115
+ type: string
3116
+ description: Name of the nearest tested function.
3117
+ distance:
3118
+ type: integer
3119
+ format: int32
3120
+ description: Number of call graph hops to the nearest tested function.
3121
+ TestedFunction:
3122
+ type: object
3123
+ description: A production function reachable from at least one test function.
3124
+ required:
3125
+ - file
3126
+ - name
3127
+ - line
3128
+ - type
3129
+ - testFiles
3130
+ - directTestCallers
3131
+ - transitiveTestCallers
3132
+ properties:
3133
+ file:
3134
+ type: string
3135
+ description: File path relative to repository root.
3136
+ name:
3137
+ type: string
3138
+ description: Name of the function or method.
3139
+ line:
3140
+ type: integer
3141
+ format: int32
3142
+ description: Line number where the function is declared.
3143
+ type:
3144
+ type: string
3145
+ description: Type of code element.
3146
+ enum:
3147
+ - function
3148
+ - class
3149
+ - method
3150
+ - interface
3151
+ - type
3152
+ - variable
3153
+ - constant
3154
+ testFiles:
3155
+ type: array
3156
+ description: Test files that cover this function (directly or transitively).
3157
+ items:
3158
+ type: string
3159
+ directTestCallers:
3160
+ type: integer
3161
+ format: int32
3162
+ description: Number of test functions that directly call this function.
3163
+ transitiveTestCallers:
3164
+ type: integer
3165
+ format: int32
3166
+ description: Number of test functions that transitively reach this function.
3167
+ TestFileInfo:
3168
+ type: object
3169
+ description: Information about a detected test file.
3170
+ required:
3171
+ - file
3172
+ - testFunctions
3173
+ - productionFunctionsCovered
3174
+ - productionFilesCovered
3175
+ properties:
3176
+ file:
3177
+ type: string
3178
+ description: File path relative to repository root.
3179
+ testFunctions:
3180
+ type: integer
3181
+ format: int32
3182
+ description: Number of test functions defined in this file.
3183
+ productionFunctionsCovered:
3184
+ type: integer
3185
+ format: int32
3186
+ description: Number of unique production functions covered by tests in this file.
3187
+ productionFilesCovered:
3188
+ type: integer
3189
+ format: int32
3190
+ description: Number of unique production files covered by tests in this file.
3191
+ CoverageByDomain:
3192
+ type: object
3193
+ description: Test coverage breakdown for a domain.
3194
+ required:
3195
+ - domain
3196
+ - totalFunctions
3197
+ - testedFunctions
3198
+ - coveragePercentage
3199
+ properties:
3200
+ domain:
3201
+ type: string
3202
+ description: Domain name from domain classification.
3203
+ totalFunctions:
3204
+ type: integer
3205
+ format: int32
3206
+ description: Total functions in the domain.
3207
+ testedFunctions:
3208
+ type: integer
3209
+ format: int32
3210
+ description: Number of tested functions in the domain.
3211
+ coveragePercentage:
3212
+ type: number
3213
+ format: double
3214
+ description: Coverage percentage for the domain.
3215
+ CoverageByFile:
3216
+ type: object
3217
+ description: Test coverage breakdown for a production file.
3218
+ required:
3219
+ - file
3220
+ - totalFunctions
3221
+ - testedFunctions
3222
+ - untestedFunctions
3223
+ - coveragePercentage
3224
+ properties:
3225
+ file:
3226
+ type: string
3227
+ description: File path relative to repository root.
3228
+ totalFunctions:
3229
+ type: integer
3230
+ format: int32
3231
+ description: Total functions in the file.
3232
+ testedFunctions:
3233
+ type: integer
3234
+ format: int32
3235
+ description: Number of tested functions in the file.
3236
+ untestedFunctions:
3237
+ type: integer
3238
+ format: int32
3239
+ description: Number of untested functions in the file.
3240
+ coveragePercentage:
3241
+ type: number
3242
+ format: double
3243
+ description: Coverage percentage for the file.
3244
+ CircularDependencyResponse:
3245
+ type: object
3246
+ description: Circular dependency analysis result containing detected cycles and summary.
3247
+ required:
3248
+ - metadata
3249
+ - cycles
3250
+ - summary
3251
+ properties:
3252
+ metadata:
3253
+ $ref: '#/components/schemas/CircularDependencyMetadata'
3254
+ cycles:
3255
+ type: array
3256
+ description: Detected dependency cycles.
3257
+ items:
3258
+ $ref: '#/components/schemas/CircularDependencyCycle'
3259
+ summary:
3260
+ $ref: '#/components/schemas/CircularDependencySummary'
3261
+ CircularDependencyMetadata:
3262
+ type: object
3263
+ description: Summary statistics for the circular dependency analysis.
3264
+ required:
3265
+ - totalFiles
3266
+ - totalImports
3267
+ - cycleCount
3268
+ - analysisMethod
3269
+ properties:
3270
+ totalFiles:
3271
+ type: integer
3272
+ format: int32
3273
+ description: Total number of files in the dependency graph.
3274
+ totalImports:
3275
+ type: integer
3276
+ format: int32
3277
+ description: Total number of import relationships.
3278
+ cycleCount:
3279
+ type: integer
3280
+ format: int32
3281
+ description: Number of cycles found.
3282
+ analysisMethod:
3283
+ type: string
3284
+ description: Algorithm used for cycle detection (e.g., tarjan_scc).
3285
+ analysisStartTime:
3286
+ type: string
3287
+ format: date-time
3288
+ description: Timestamp when analysis started.
3289
+ analysisEndTime:
3290
+ type: string
3291
+ format: date-time
3292
+ description: Timestamp when analysis completed.
3293
+ CircularDependencyCycle:
3294
+ type: object
3295
+ description: A single dependency cycle (strongly connected component).
3296
+ required:
3297
+ - id
3298
+ - files
3299
+ - edges
3300
+ - severity
3301
+ properties:
3302
+ id:
3303
+ type: string
3304
+ description: Unique identifier for this cycle (e.g., cycle-1).
3305
+ files:
3306
+ type: array
3307
+ description: Files involved in this cycle, sorted alphabetically.
3308
+ items:
3309
+ type: string
3310
+ edges:
3311
+ type: array
3312
+ description: Import edges that form this cycle.
3313
+ items:
3314
+ $ref: '#/components/schemas/CycleEdge'
3315
+ severity:
3316
+ type: string
3317
+ description: Severity of this cycle based on cross-directory span and size.
3318
+ enum:
3319
+ - low
3320
+ - medium
3321
+ - high
3322
+ breakingSuggestion:
3323
+ type: string
3324
+ description: Suggested edge to break to resolve this cycle.
3325
+ CycleEdge:
3326
+ type: object
3327
+ description: A directed import edge within a cycle.
3328
+ required:
3329
+ - source
3330
+ - target
3331
+ - importedSymbols
3332
+ properties:
3333
+ source:
3334
+ type: string
3335
+ description: File path of the importing file.
3336
+ target:
3337
+ type: string
3338
+ description: File path of the imported file.
3339
+ importedSymbols:
3340
+ type: array
3341
+ description: Symbols imported along this edge.
3342
+ items:
3343
+ type: string
3344
+ CircularDependencySummary:
3345
+ type: object
3346
+ description: Aggregate summary of circular dependency analysis.
3347
+ required:
3348
+ - totalCycles
3349
+ - filesInCycles
3350
+ - highSeverityCount
3351
+ - mediumSeverityCount
3352
+ - lowSeverityCount
3353
+ properties:
3354
+ totalCycles:
3355
+ type: integer
3356
+ format: int32
3357
+ description: Total number of cycles found.
3358
+ filesInCycles:
3359
+ type: integer
3360
+ format: int32
3361
+ description: Number of unique files involved in at least one cycle.
3362
+ highSeverityCount:
3363
+ type: integer
3364
+ format: int32
3365
+ description: Number of high-severity cycles.
3366
+ mediumSeverityCount:
3367
+ type: integer
3368
+ format: int32
3369
+ description: Number of medium-severity cycles.
3370
+ lowSeverityCount:
3371
+ type: integer
3372
+ format: int32
3373
+ description: Number of low-severity cycles.
2167
3374
  Error:
2168
3375
  type: object
2169
3376
  description: Standardized error payload returned by the API.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supermodeltools/openapi-spec",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Supermodel Public OpenAPI Specification",
5
5
  "main": "openapi.yaml",
6
6
  "files": [