Skip to content

Commit f33ba67

Browse files
docs(analysis): clarify unbounded page analysis cost
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent bc38795 commit f33ba67

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/analysis/changes/service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ func (s *Service) Analyze(ctx context.Context, repoDir, baseRef string) ([]RiskE
8484
}
8585

8686
// AnalyzePage detects changed functions and returns one bounded page of risk entries.
87-
// @intent push pagination into the change-risk service so handlers expose stable limit/offset windows.
87+
// @intent bound the response size for handlers while Analyze still materializes the full risk list before slicing.
88+
// @domainRule pagination limits returned items, but compute cost still scales with the full diff-to-risk pipeline.
8889
// @domainRule entries are sorted by descending risk_score, then file_path, then qualified_name for stable ordering.
8990
func (s *Service) AnalyzePage(ctx context.Context, repoDir, baseRef string, req paging.Request) (Result, error) {
9091
normalized, err := paging.Normalize(req)

internal/analysis/coupling/service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func (s *Service) Analyze(ctx context.Context) ([]CouplingPair, error) {
118118
}
119119

120120
// AnalyzePage returns one bounded page of coupling pairs.
121-
// @intent push pagination into the coupling service so handlers expose stable limit/offset windows without slicing unbounded slices.
121+
// @intent bound the response size for handlers while Analyze still aggregates the full coupling set before slicing.
122+
// @domainRule pagination limits returned items, but compute cost still scales with the full edge aggregation.
122123
// @domainRule pairs are sorted by descending strength, then descending edge count, then from/to community for stable pagination.
123124
func (s *Service) AnalyzePage(ctx context.Context, req paging.Request) (Result, error) {
124125
normalized, err := paging.Normalize(req)

0 commit comments

Comments
 (0)