Repository navigation
fix: Compose OAuth behavior annotations with current catalog - #1252
Conversation
Require explicit behavioral hints, cover full and limited catalogs, document classifications, and disable preview deployments for this review branch.
Pre-merge checks:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
7 issues found and verified against the latest diff
Confidence score: 4/5
- The OAuth registration and policy modules exceed the 100-line limit, and the operation registry grows further past it. Split the cohesive logic and operation descriptors into smaller modules.
catalogCaseToolOperations.tsmarkssave_catalog_caseas destructive even though it saves a revision without deleting data. Set the flag tofalseto match the tool’s behavior and hint.- In
docs/mcp-oauth-annotations.md, the migration source cells combine two URLs into one link, and thegenerate_imagejustification describes editing instead of generating. Make each URL separately clickable and update the justification. registerOAuthTools.test.tsnow exceeds the 100-line limit. Trim the test or split out the new annotations coverage.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/mcp/oauth/contextToolOperations.ts">
<violation number="1" location="lib/mcp/oauth/contextToolOperations.ts:15">
P2: Custom agent: **Enforce Clear Code Style and Maintainability Practices**
This change grows an already 158-line operation registry to 219 lines, further exceeding the rule’s 100-line limit. Move operation descriptors into focused modules and keep this composition file under 100 lines.</violation>
</file>
<file name="docs/mcp-oauth-annotations.md">
<violation number="1" location="docs/mcp-oauth-annotations.md:44">
P3: These source cells put two URLs inside one Markdown link, so the migration evidence is not separately clickable. Split each source cell into two links.</violation>
<violation number="2" location="docs/mcp-oauth-annotations.md:47">
P3: The `generate_image` justification refers to "edit", copied from the `edit_image` row. Replace that clause with a generation-specific description so the inventory is accurate for this tool.</violation>
</file>
<file name="lib/mcp/oauth/catalogCaseToolOperations.ts">
<violation number="1" location="lib/mcp/oauth/catalogCaseToolOperations.ts:19">
P2: `save_catalog_case` is marked `destructive: true`, but it only saves a new revision with server-maintained history and deletes nothing. Set it to `false` to match the other context writes and the `destructiveHint: false` that `registerCatalogCaseTools` actually emits. Otherwise this metadata contradicts the registered annotation.</violation>
</file>
<file name="lib/mcp/oauth/fullOAuthToolPolicy.ts">
<violation number="1" location="lib/mcp/oauth/fullOAuthToolPolicy.ts:221">
P2: Custom agent: **Enforce Clear Code Style and Maintainability Practices**
These policy additions bring `fullOAuthToolPolicy.ts` to 222 lines, more than twice the 100-line limit. Split the inventory into cohesive modules under 100 lines each.</violation>
</file>
<file name="lib/mcp/oauth/__tests__/registerOAuthTools.test.ts">
<violation number="1" location="lib/mcp/oauth/__tests__/registerOAuthTools.test.ts:94">
P3: Custom agent: **Enforce Clear Code Style and Maintainability Practices**
This file is now 103 lines, over the 100-line cap in the code-style rules, and the new annotations test is what pushed it past the limit. Trim the added test or fixture lines so the file stays under 100 lines (at or below 99).</violation>
</file>
<file name="lib/mcp/oauth/registerFullOAuthTools.ts">
<violation number="1" location="lib/mcp/oauth/registerFullOAuthTools.ts:91">
P2: Custom agent: **Enforce Clear Code Style and Maintainability Practices**
This 229-line module is more than twice Rule 3’s 100-line limit, and this change expands its registration-policy logic further. Split a cohesive responsibility into a separate module to bring this file under the limit.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -12,147 +12,208 @@ export const contextToolOperations = { | |||
| name: "list_music_release_cases", | |||
There was a problem hiding this comment.
P2: Custom agent: Enforce Clear Code Style and Maintainability Practices
This change grows an already 158-line operation registry to 219 lines, further exceeding the rule’s 100-line limit. Move operation descriptors into focused modules and keep this composition file under 100 lines.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At lib/mcp/oauth/contextToolOperations.ts, line 15:
<comment>This change grows an already 158-line operation registry to 219 lines, further exceeding the rule’s 100-line limit. Move operation descriptors into focused modules and keep this composition file under 100 lines.</comment>
<file context>
@@ -12,147 +12,208 @@ export const contextToolOperations = {
name: "list_music_release_cases",
description: "List saved release cases and their review status.",
readOnly: true,
+ destructive: false,
+ openWorld: false,
},
</file context>
| @@ -1,141 +1,222 @@ | |||
| interface ToolPolicy { | |||
There was a problem hiding this comment.
P2: Custom agent: Enforce Clear Code Style and Maintainability Practices
These policy additions bring fullOAuthToolPolicy.ts to 222 lines, more than twice the 100-line limit. Split the inventory into cohesive modules under 100 lines each.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At lib/mcp/oauth/fullOAuthToolPolicy.ts, line 221:
<comment>These policy additions bring `fullOAuthToolPolicy.ts` to 222 lines, more than twice the 100-line limit. Split the inventory into cohesive modules under 100 lines each.</comment>
<file context>
@@ -1,141 +1,222 @@
+ },
+ publish_site: { readOnly: false, destructive: true, openWorld: true },
+ unpublish_site: { readOnly: false, destructive: true, openWorld: true },
+ delete_site: { readOnly: false, destructive: true, openWorld: true },
};
</file context>
| ? { | ||
| readOnly: operation.readOnly, | ||
| destructive: operation.destructive, | ||
| openWorld: operation.openWorld, |
There was a problem hiding this comment.
P2: Custom agent: Enforce Clear Code Style and Maintainability Practices
This 229-line module is more than twice Rule 3’s 100-line limit, and this change expands its registration-policy logic further. Split a cohesive responsibility into a separate module to bring this file under the limit.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At lib/mcp/oauth/registerFullOAuthTools.ts, line 91:
<comment>This 229-line module is more than twice Rule 3’s 100-line limit, and this change expands its registration-policy logic further. Split a cohesive responsibility into a separate module to bring this file under the limit.</comment>
<file context>
@@ -79,7 +85,12 @@ export function registerFullOAuthTools(
+ ? {
+ readOnly: operation.readOnly,
+ destructive: operation.destructive,
+ openWorld: operation.openWorld,
+ notice: "",
+ }
</file context>
| description: | ||
| "Save a bounded portable catalog case as a customer assertion. Requires last read revision and an idempotency key. Does not verify rights, authorize provider operations, register music or collect royalties. History is server-maintained; omit local history.", | ||
| readOnly: false, | ||
| destructive: true, |
There was a problem hiding this comment.
P2: save_catalog_case is marked destructive: true, but it only saves a new revision with server-maintained history and deletes nothing. Set it to false to match the other context writes and the destructiveHint: false that registerCatalogCaseTools actually emits. Otherwise this metadata contradicts the registered annotation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At lib/mcp/oauth/catalogCaseToolOperations.ts, line 19:
<comment>`save_catalog_case` is marked `destructive: true`, but it only saves a new revision with server-maintained history and deletes nothing. Set it to `false` to match the other context writes and the `destructiveHint: false` that `registerCatalogCaseTools` actually emits. Otherwise this metadata contradicts the registered annotation.</comment>
<file context>
@@ -7,30 +7,45 @@ export const catalogCaseToolOperations = {
description:
"Save a bounded portable catalog case as a customer assertion. Requires last read revision and an idempotency key. Does not verify rights, authorize provider operations, register music or collect royalties. History is server-maintained; omit local history.",
readOnly: false,
+ destructive: true,
+ openWorld: false,
delegated: false,
</file context>
| destructive: true, | |
| destructive: false, |
| ).toThrow(); | ||
| }); | ||
|
|
||
| it("sets explicit behavior-based annotations for every limited tool", () => { |
There was a problem hiding this comment.
P3: Custom agent: Enforce Clear Code Style and Maintainability Practices
This file is now 103 lines, over the 100-line cap in the code-style rules, and the new annotations test is what pushed it past the limit. Trim the added test or fixture lines so the file stays under 100 lines (at or below 99).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At lib/mcp/oauth/__tests__/registerOAuthTools.test.ts, line 94:
<comment>This file is now 103 lines, over the 100-line cap in the code-style rules, and the new annotations test is what pushed it past the limit. Trim the added test or fixture lines so the file stays under 100 lines (at or below 99).</comment>
<file context>
@@ -86,3 +90,14 @@ it("rejects profile updates with no changed fields", () => {
).toThrow();
});
+
+it("sets explicit behavior-based annotations for every limited tool", () => {
+ const { tools } = fixture();
+ for (const [name, tool] of tools) {
</file context>
…uth-annotations-current-main
There was a problem hiding this comment.
0 issues found across 5 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
View guided diff | Turn on auto-fix | Re-trigger cubic
Problem and result
OAuth tool annotations must describe side effects consistently across full and limited discovery. This successor preserves candidate #1238 and normally composes it with current main
10fce9198fc4bacf184405e7792563fec90f7496. Current head:c7e2a2e70c75602cb781f9b6ce6bfd91666ea080.Explicit read-only, destructive and open-world policy covers the full and limited registries, including three current social tools. Discovery tests verify 94 full registrations / 93 model-visible tools and 7 limited registrations / 6 model-visible tools. Standard-only catalog preparation and ingestion remain excluded. Handler behavior, schemas, authentication and scopes are unchanged.
Validation and reviews
Focused discovery/annotation tests passed (3 files, 7 tests), as did local lint, production types and contract checks on the original successor. The 12 contribution files and complete contribution patch remain byte-identical through both normal main merges. Incoming Sites files match accepted main exactly. Fresh final-head required CI is tracked below by GitHub.
Independent exact-head Spec: 0 findings. Standards: 0 findings. Codex completed with zero findings and Cubic reviewed 12/12 files at
50cad80d(reported coverage 94%); Cubic skipped subsequent merge-only commits. Those automated reviews cover the unchanged contribution, not an exact-head automated composition review.CodeRabbit's pre-merge warning uses stale
60af5644base. Catalog/LinkedIn refactors it attributes to this PR are already in main. The catalog annotation mismatch was subsequently corrected narrowly in standard registration without granting delegated access. Repeated policy triples are an intentional audit inventory. Independent triage found no actionable in-scope correction; this does not erase the warning or claim a completed full CodeRabbit review.Release boundary
Both deployment guards remain false:
fix/mcp-oauth-behavior-annotationsandcodex/oauth-annotations-current-main. Original draft #1238 is untouched. Ready status allows automated review only. Coordinator owns merge/release approval. The source-release decision below authorizes the normal main merge and its normal deployment; plugin resubmission remains unapproved.For deployed metadata acceptance and broader client release sign-off, verify authenticated tools/list on the exact endpoint in both existing OAuth modes and the four standard Catalog metadata tuples through an already authorized client. Deployed database settlement and native-client behavior remain separate owning-epic acceptance. No business tool execution, new grant, migration or credential discovery is authorized by this source release.
New exact-head review corrections
The later Cubic findings on
4e5b1eewere inspected separately from prior triage. Corrected export settlement/refund wording (4605071264), image generation rationale (4605071310), six combined source links (4605071333), and explicit limited-tool visibility assertions (4605071324). For 4605071285, catalog saves retain history but replace the current revision: retained destructive:true and aligned standard registration with shared metadata. Added discovery-only standard assertions; all four catalog tools remain delegated:false and excluded from OAuth.Style comments 4605071230/1243/1257/1296: no tracked universal100-line file cap was found. Retained cohesive policy inventories and regression coverage. The existing long registration function remains maintainability debt under the actual function-length guidance; no auth/schema refactor was added.
Independent fix-diff Spec and Standards reviews: zero actionable findings. Focused tests passed4files/8tests after reproducing the standard annotation mismatch; local lint and OAuth types passed. Exact-head format, lint, compatibility and test workflows all pass. Cubic completed review of the five-file correction with zero new issues (5/5 confidence). Five earlier GitHub threads remain unresolved: the four style suggestions and the catalog metadata suggestion; their reasoned dispositions above require coordinator review, not an auto-approval claim. Guards and original1238 remain untouched.
Coordinator source-release decision
Recoup OS accepts exact
c7e2a2e70c75602cb781f9b6ce6bfd91666ea080for a normal metadata source release under the October 19 standing delivery authority. Required exact-head checks passed; independent source, Catalog-contract and reconciliation release-scope reviews found no unresolved blocking defect. Discovery hints/descriptions and the narrow standard Catalog metadata projection change; handlers, schemas, authentication, scopes, delegated exclusions and business permissions remain unchanged. The two feature-branch deployment guards remain intact.This explicitly separates the present metadata correction from the earlier broad “before any release” wording. Authenticated deployed discovery, native-client acceptance, Pack settlement correctness and whole-epic completion remain unproven and open. They are not claimed by source tests or this decision. Observe normal post-merge CI/deployment and exact revision readback; do not use mutating Pack reads/exports as smoke tests. No manual deployment, business activation, provider call, spending, database apply or plugin resubmission is included.