dylanjbarth / dylanjbarth/codex-inspector

Review rejects small scopes once global capacity history exceeds 2,000 rows

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Summary

Review generation reads capacity observations globally and applies a 2,000-row scope limit before narrowing the data to the requested Review scope. Once the global table reaches 2,001 observations, even a small single-session Review fails with review_scope_too_large.

This makes Review availability depend on unrelated historical capacity data rather than the requested session scope.

Reproduction

  1. Populate the capacity observation store with 2,001 valid observations.
  2. Request a Review for one small session.
  3. Observe the Review failure.

Observed result:

review_scope_too_large

A regression probe reproduced this against commit aad5070435fd9944e0cf38d32cba5d53e25425c4.

Expected behavior

The size guard should apply to the requested Review scope, or capacity lookup should fetch only the latest observation relevant to that scope. Unrelated global capacity history must not cause a small Review to fail.

Relevant code

Acceptance criteria

  • A small single-session Review succeeds when global capacity history contains more than 2,000 rows.
  • Capacity lookup is bounded by the requested scope or by a targeted latest-observation query.
  • A regression test covers 2,001+ global observations with a small Review scope.
  • Legitimately oversized Review scopes still return the documented size error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/reviews/plan.go around the global capacity query and row limit at line 128. Reproduce the failure with 2,001 observations and a small single-session Review, then add coverage for that case while preserving the documented size error for genuinely oversized Review scopes. Done means the small Review succeeds despite unrelated global history.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.