Skip to content

fix(code-index): preserve deterministic text sizing evidence - #1774

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
fix/text-budget-classification
Sep 18, 2026
Merged

ScriptedAlchemy merged 1 commit into
masterfrom
fix/text-budget-classification

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Live defect

After the nested-repository fix, the fresh 5,259-file generation completed (phase=ready, all files/pages committed), but text projection failed before graph seating in a tight loop:

error=the read port exceeded its bounded work budget

That string discarded the cause. map_text_artifact_error mapped all of these to the same RetrievalPortError::BudgetExceeded:

  1. actual control deadline exceeded (transient/request-bound),
  2. Unreserved(detail) (availability/capacity),
  3. BatchTooLarge { limit, required, maximum } after the source had already subdivided to one record (deterministic for this record/budget).

text_artifact_builder_budget also returned bare BudgetExceeded when the retained source window alone exhausted the fixed reservation—also deterministic.

Fix

  • Deadline remains BudgetExceeded.
  • Unreserved(detail) becomes AuthorityUnavailable with its reservation detail.
  • An indivisible BatchTooLarge becomes Contract(error.to_string()), retaining limit/required/maximum. The convergence worker now parks it once instead of retrying the same bytes.
  • Source-window exhaustion becomes a Contract naming needed and available bytes.

This is diagnostic classification, not a budget increase. It exposes the exact remaining sizing defect so the next fix removes the cost rather than tuning a number.

Checked existing PRs first: the #1562/#1577 stack touches serving, but not these mappings or budget split.

Evidence: focused subdivision/reservation tests 2/2; all text-artifact runtime tests 20/20; rustfmt and IDE lints clean.

Text projection collapsed three different failures into BudgetExceeded: a
real deadline, an unavailable reservation, and an indivisible batch whose
record exceeds a fixed builder bound. The latter two lost their detail, and
the background worker retried a deterministic refusal continuously while
status could only say a read budget was exceeded. Keep deadline exhaustion as
BudgetExceeded, retain reservation detail as unavailable, and project an
indivisible batch or source-window overflow as a contract with its required
and maximum bytes so convergence parks once and reports the actionable cause.
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8e75b08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy
ScriptedAlchemy merged commit 9aae729 into master Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant