Skip to content

fix(kiro): keep unbounded tool catalog admission linear - #8804

Merged
lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:fix/kiro-unbounded-catalog-linear
Nov 17, 2026
Merged

lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:fix/kiro-unbounded-catalog-linear

Conversation

@luvs01

@luvs01 luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Keep Kiro catalog admission linear when OCX_KIRO_TOOL_BUDGET=off by constructing projected catalogs only while enforcing the budget.
  • Preserve declaration order, every admitted tool, schema/description conversion, and the existing default count/byte limits and code-mode exec reservation.
  • Add bounded, deterministic regression coverage for repeated converted-tool traversal, with and without the reserved execution tool.

Verification

Validation of 6d0cf4653d566b150453393ecf3e822db702ec3d, integrating dev at da021e37dc15ba740aaca05fd4fd125c12df578e. The three-file feature diff is byte-identical to the previously tested patch.

  • Bun 1.4.4: bun test tests/providers/kiro/kiro-tool-catalog.test.ts — 17 passed, 41 assertions.
  • bun test --isolate --parallel=1 tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/structure-ssot.test.ts — 60 passed, 188 assertions.
  • bun run typecheck — no errors in 2,549 files.
  • bun run structure:check, bun run privacy:scan, and git diff --check — passed.
  • The catalog regressions exercise 2,048-tool traversal with and without reserved exec, along with existing order, budget, schema, description and effort behavior.
  • The repository's resource exception was used for full local/import-graph coverage because of concurrent Windows worktree validation load. Focused tests retained the checked-in isolation preload and semantic lock.
  • Exact-head upstream CI 43854905698, catalog contracts 43854905835, and PR gates 43854901699 passed. The CI run covers the configured fast PR subset; skipped native-platform jobs are outside this verification.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The security checkbox records implementation review; explicit maintainer security review remains required before merge.

Summary by CodeRabbit

  • Bug Fixes
    • Catalog budget checks now account for the reserved execution tool when deciding which other tools can be included.
    • With catalog budgeting turned off, tools are processed in declaration order without projection or limit checks. Oversized catalogs are sent to Kiro, which may reject them with a validation error.
    • Added coverage to verify order and processing behavior for large catalogs, with and without the reserved execution tool.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Kiro tool admission now skips projected catalog construction and measurement when OCX_KIRO_TOOL_BUDGET=off. When budgeting is enabled, checks include the reserved execution tool. Tests cover traversal, ordering, and notices for catalogs with 2,048 tools.

Changes: Kiro tool admission

Layer / File(s) Summary
Catalog admission and budget opt-out
src/adapters/kiro-tools.ts, tests/providers/kiro/kiro-tool-catalog.test.ts, structure/providers/kiro.md
At src/adapters/kiro-tools.ts:285-291, enabled budget checks account for the reserved execution tool. The tests at tests/providers/kiro/kiro-tool-catalog.test.ts:90-126 check traversal bounds, declared order, and system notices with budgeting off. The documentation at structure/providers/kiro.md:157-159 describes the opt-out behavior and upstream failure mode.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 8306: This change addresses the tool-count and byte-budget behavior when OCX_KIRO_TOOL_BUDGET=off. The other objectives described in the issue are outside this change.
Merge Risk: Minimal · up to 6d0cf

With the Kiro tool budget off, admission of large tool catalogs now does linear work, and the budgeted behavior is unchanged. No concrete merge-blocking risk was found; the author notes that maintainer security review is still required.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(kiro): keep unbounded tool catalog admission linear" matches the main change. The PR builds projected Kiro tool catalogs only when budget enforcement is on, so admission stays linear wh…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(kiro): keep unbounded tool catalog admission linear" matches the main change. The PR builds projected Kiro tool catalogs only when budget enforcement is on, so admission stays linear when OCX_KIRO_TOOL_BUDGET=off. The raw summary and the PR objectives both describe this change in src/adapters/kiro-tools.ts, the provider docs, and the regression test. The title is specific and concise, and it follows a conventional commit style.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between da021e3 and 6d0cf46.

Files selected for processing: 3

  • src/adapters/kiro-tools.ts
  • structure/providers/kiro.md
  • tests/providers/kiro/kiro-tool-catalog.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev under MAINTAINERS.md (not an approving review), 2026-11-17 triage round.

@lidge-jun
lidge-jun merged commit 05f11c9 into lidge-jun:dev Nov 17, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants