You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test: Check every context-guru operator outside the registry - #2174
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.
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]>
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.
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: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
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 checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
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
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.
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.
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.
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestComponentsCoverTheRegistrychecked the "operators outside the registry" against afixed list of six names. It missed
tailbreakpoint,tooldefer,expand_restoreandkeeper.accwire.OperatorsOutsideRegistry()for thoseoperators, so a future context-guru operator booked outside its registry fails this test
instead of silently landing under
component="other".toolfilter,toolschemaandcachesplitstay as a short fixed list: they are Cortex'sown 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 includeskeeper,tailbreakpoint,tooldeferandexpand_restore. Only the test's own check was missingthem, 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