Skip to content

Test: Check every context-guru operator outside the registry - #2174

Merged
boazdavid merged 1 commit into
mainfrom
fix-2111-operator-list
Nov 29, 2026
Merged

boazdavid merged 1 commit into
mainfrom
fix-2111-operator-list

Conversation

@boazdavid

@boazdavid boazdavid commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • TestComponentsCoverTheRegistry checked the "operators outside the registry" against a
    fixed list of six names. It missed tailbreakpoint, tooldefer, expand_restore and
    keeper.
  • The test now reads context-guru's own accwire.OperatorsOutsideRegistry() for those
    operators, so a future context-guru operator booked outside its registry fails this test
    instead of silently landing under component="other".
  • toolfilter, toolschema and cachesplit stay as a short fixed list: they are Cortex's
    own envelope operators, and context-guru has no registry entry to list them from.

What we found

accounting.Components (the actual allow-list used at runtime) already includes keeper,
tailbreakpoint, tooldefer and expand_restore. Only the test's own check was missing
them, so this closes a gap in the guard, not a bug in the shipped list.

How it was tested

  • go test ./core/plugins/contextguru/... ./core/accounting/... — pass.
  • gofmt -l core/plugins/contextguru/components_test.go — clean.
  • go vet ./core/plugins/contextguru/... — clean.

Fixes #2111.

Assisted-By: Claude (Anthropic AI) [email protected]

Summary by CodeRabbit

  • Tests
    • Updated automated checks to verify that component registration and supported envelope operators remain consistent. The checks now reflect the current operator set, helping detect mismatches or unintended changes in future updates. These changes affect validation only; no end-user-facing functionality changed.

TestComponentsCoverTheRegistry checked a fixed list of six operators that
Cortex's own envelope ops report. It missed tailbreakpoint, tooldefer,
expand_restore and keeper, so a regression there would have gone
unnoticed, and the list could not catch a new context-guru operator
booked outside the registry.

Read context-guru's own accwire.OperatorsOutsideRegistry() for the
context-guru operators instead of copying them by hand; keep a short
fixed list only for toolfilter, toolschema and cachesplit, which are
Cortex's own operators that context-guru has no way to list for us.

Fixes #2111.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
@boazdavid
boazdavid requested a review from a team as a code owner November 29, 2026 15:04
@github-actions github-actions Bot added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The context-guru component test now checks that operators outside the registry appear in accounting.Components. Its explicit envelope-operator list now includes toolfilter, toolschema, and cachesplit.

Changes: Operator coverage check

Layer / File(s) Summary
Check operators outside the registry
core/plugins/contextguru/components_test.go
The test checks every operator returned by accwire.OperatorsOutsideRegistry() against accounting.Components. The explicit envelope-operator list now contains toolfilter, toolschema, and cachesplit.

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

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: huang195, rubambiza

Merge Risk: Minimal · up to b9bb8

This change only updates a test guard so context-guru operators missing from the accounting component list are detected automatically. It does not affect shipped behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #2111 has two requirements. (1) Add tailbreakpoint, tooldefer, expand_restore and keeper to the test check. The PR meets this indirectly. The test now loops over accwire.OperatorsOutsideRegistry… Confirm that the context-guru module version pinned in core/go.mod (v0.7.9) exports accwire.OperatorsOutsideRegistry() and contains rossoctl/context-guru#1362. Confirm that the returned list includes headttl, expand and adjudicate, or docum…
Passed Passed checks: 3 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the test change in the context-guru components test. It does not name the main change. The main change is that the test now reads the operators outside the registry from accwire.Operat…
Out of Scope Changes check Passed The only changed file is core/plugins/contextguru/components_test.go. Its changes concern the guard test that issue #2111 names. They add the accwire import, add the dynamic check over OperatorsOutsid…
Full details: Title check

Explanation

The title names the test change in the context-guru components test. It does not name the main change. The main change is that the test now reads the operators outside the registry from accwire.OperatorsOutsideRegistry() instead of a copied fixed list, and that the fixed list now covers only Cortex's own envelope operators. The title says the test checks every context-guru operator outside the registry, which matches the objective. It is specific and uses no vague terms.

Full details: Out of Scope Changes check

Explanation

The only changed file is core/plugins/contextguru/components_test.go. Its changes concern the guard test that issue #2111 names. They add the accwire import, add the dynamic check over OperatorsOutsideRegistry(), and narrow the fixed envelope list to toolfilter, toolschema and cachesplit. No unrelated code, dependency or configuration changes appear in the diff. The removal of headttl, expand and adjudicate from the fixed list is related to the issue scope. Its justification is not stated in the PR description. This point is covered in the linked-issue assessment.

Full details: Linked Issues check

Explanation

Issue #2111 has two requirements. (1) Add tailbreakpoint, tooldefer, expand_restore and keeper to the test check. The PR meets this indirectly. The test now loops over accwire.OperatorsOutsideRegistry() and checks each name against accounting.Components. The PR description states that accounting.Components already contains these four names. The diff does not show them as explicit entries, so their coverage depends on the function's return value. (2) Replace the fixed list with accwire.OperatorsOutsideRegistry() after bumping context-guru to a release containing rossoctl/context-guru#1362. The diff changes components_test.go only. core/go.mod already requires github.com/rossoctl/context-guru v0.7.9 at the merge base, and the PR does not change it. The repository content available here does not show whether v0.7.9 defines accwire.OperatorsOutsideRegistry or includes #1362. The PR also removes headttl, expand and adjudicate from the envelope-operator check. The PR description does not explain this removal. These names are covered only if OperatorsOutsideRegistry() returns them. This cannot be established from the available evidence.

Resolution

Confirm that the context-guru module version pinned in core/go.mod (v0.7.9) exports accwire.OperatorsOutsideRegistry() and contains rossoctl/context-guru#1362. Confirm that the returned list includes headttl, expand and adjudicate, or document why those names no longer need a check. Confirm that the package compiles at the reviewed head.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d857796-578c-4c2c-8c67-6dc5e80c01cd
Commits

Reviewing files that changed from the base of the PR and between 414411f and b9bb8f7.

Files selected for processing: 1

  • core/plugins/contextguru/components_test.go

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

@clawgenti clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The change does what it says. I ran a mutation check locally (context-guru v0.7.9, as pinned in core/go.mod): I removed headttl, tailbreakpoint, tooldefer, expand and expand_restore from accounting.Components. The new test reports all five. The base test reports only expand and misses tailbreakpoint, tooldefer and expand_restore, which matches the gap described in #2111. accwire.OperatorsOutsideRegistry() returns [keeper headttl tailbreakpoint tooldefer expand adjudicate expand_restore], so all four missed operators are now covered, and a new context-guru operator will be too.

One non-blocking point, inline: the comment and PR description say toolfilter, toolschema and cachesplit are operators context-guru "does not know about". In v0.7.9 all three are registered components: components.Names() returns them, so the first loop already checks them. What actually sets these names apart is that Cortex's envelope.go emits them as its own string literals. By that rule, headttl, expand and adjudicate belong in the fixed list too.

Author: boazdavid (CONTRIBUTOR association, repo admin permission: maintainer)
Areas reviewed: Go (tests)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing. The Go CI (core) job has no annotations. I could not fetch its log, so I ran the test locally on the head, and it passes.

}
// And the operators Cortex's own envelope ops report, which context-guru does not know
// about and so cannot list for us.
for _, n := range []string{"toolfilter", "toolschema", "cachesplit"} {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: This comment, and the PR description's "context-guru has no registry entry to list them from", are inaccurate. At context-guru v0.7.9, components.Names() includes toolfilter, toolschema and cachesplit. So they are context-guru registry components, and the cgcomponents.Names() loop above already checks them.

This list is still useful, but for a different reason. Cortex's own core/plugins/contextguru/envelope.go emits these names as string literals: toolfilter, toolschema, cachesplit, headttl, expand, adjudicate. The list pins what Cortex books, whatever context-guru lists. On that reasoning, dropping headttl, expand and adjudicate loosens the guard. Suppose a context-guru bump renames or drops one of them in OperatorsOutsideRegistry(). Cortex's envelope ops would keep emitting the old literal, it would land in other, and the test would still pass.

Suggestion: keep the original six names here and reword the comment, for example: "operators Cortex's own envelope ops (envelope.go) emit by literal name, pinned independently of context-guru's lists".

@boazdavid
boazdavid merged commit 171c753 into main Nov 29, 2026
44 checks passed
@boazdavid
boazdavid deleted the fix-2111-operator-list branch November 29, 2026 15:33
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test(accounting): [cg] Check every context-guru operator outside the registry in accounting.Components

2 participants