Repository navigation
Dedupe SDK option contracts and type folder helpers - #394
Conversation
Reuse the type-registry default-folder helper for custom item storage, share SDK tool option contract groups instead of repeating filter slices, and replace unnecessary Sentry test any payload typings. PM evidence: continues pm-92if; documents pm-rj3w public-scope deferral for ignored production telemetry files; links changed files and sandbox-compatible tests with current evidence. Verification: pnpm build; focused source-quality tests; full coverage 256 files / 5138 tests / 100/100/100/100; pnpm typecheck; pnpm lint; pnpm quality:static; pnpm contracts:check; pnpm security:scan; pnpm audit --audit-level moderate; git diff --check; pm test pm-92if --run --progress 14/14; manual temp smoke with research-note custom type; changelog:pm:check unchanged with pm-changelog 2026.6.27; health/package doctor/Sentry telemetry gates clean.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Reviewer's GuideThis PR centralizes shared SDK tool option flag contracts, reuses the type-registry’s default-folder helper in store path resolution, tightens Sentry helper test typings, and records new pm evidence metadata. Flow diagram for shared SDK tool option contract slicesflowchart LR
BASIC[TOOL_BASIC_ITEM_FILTER_OPTION_CONTRACTS]
INCR[TOOL_INCREMENTAL_ITEM_FILTER_OPTION_CONTRACTS]
GOV[TOOL_GOVERNANCE_MISSING_OPTION_CONTRACTS]
CONTENT[TOOL_CONTENT_PRESENCE_OPTION_CONTRACTS]
LIST[TOOL_LIST_FILTER_OPTION_CONTRACTS]
AGG[TOOL_AGGREGATE_OPTION_CONTRACTS]
DEDUPE[TOOL_DEDUPE_AUDIT_OPTION_CONTRACTS]
SEARCH[TOOL_SEARCH_FILTER_OPTION_CONTRACTS]
BASIC --> INCR
INCR --> LIST
GOV --> LIST
CONTENT --> LIST
BASIC --> AGG
BASIC --> DEDUPE
INCR --> SEARCH
GOV --> SEARCH
CONTENT --> SEARCH
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@codex review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
📝 WalkthroughWalkthroughUpdates ChangesSource Quality Cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
Greptile SummaryThis PR deduplicates two parallel implementations of the same logic: the custom item-type folder derivation in
Confidence Score: 5/5Safe to merge — all changes are pure deduplication with no behavioral differences. The two removed deriveDefaultTypeFolder/toSlugToken helpers in paths.ts are byte-for-byte identical to toDefaultFolder/toSlugToken in type-registry.ts, so replacing the call site is risk-free. The SDK contract refactoring preserves element order and set for every exported array, the new cloneOptionContracts helper prevents cross-array mutation, and the existing contracts:check gate would catch any snapshot drift. No files require special attention. Important Files Changed
Reviews (9): Last reviewed commit: "chore: avoid intermediate SDK option dou..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/sdk/cli-contracts/tool-option-contracts.ts`:
- Around line 22-29: The composite option contract arrays are relying on
hard-coded slice boundaries, which makes them fragile when the base lists are
reordered. Update the contract composition in
TOOL_INCREMENTAL_ITEM_FILTER_OPTION_CONTRACTS and the related INCREMENTAL
exports to use explicit named sub-arrays instead of numeric slice calls, so the
split point is clear and refactor-safe. Keep the existing ordering by splitting
the base contracts into before/after the date-related fields and composing from
those symbols rather than from TOOL_BASIC_ITEM_FILTER_OPTION_CONTRACTS and
TOOL_INCREMENTAL_ITEM_FILTER_OPTION_CONTRACTS slices.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 195eba12-64de-4bf0-a652-ec2298e8d038
📒 Files selected for processing (8)
.agents/pm/epics/pm-92if.toon.agents/pm/extensions/.managed-extensions.json.agents/pm/history/pm-92if.jsonl.agents/pm/history/pm-rj3w.jsonl.agents/pm/issues/pm-rj3w.toonsrc/core/store/paths.tssrc/sdk/cli-contracts/tool-option-contracts.tstests/unit/core/sentry/sentry-helpers.spec.ts
There was a problem hiding this comment.
1 issue found across 8 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Address CodeRabbit and cubic feedback by replacing numeric slice boundaries in tool option contract composition with named base, window, relation, and search relation groups while preserving the exported contract order. Verification: no .slice( calls remain in tool-option-contracts.ts; pnpm contracts:check; focused contracts/SDK tests; pnpm typecheck; pnpm lint; pnpm security:scan; git diff --check; full coverage 256 files / 5138 tests / 100/100/100/100; linked focused pm test 197 tests.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request introduces several source-quality improvements and refactorings. It single-sources custom item default-folder derivation in src/core/store/paths.ts by leveraging the type-registry, deduplicates SDK tool option contracts in src/sdk/cli-contracts/tool-option-contracts.ts into reusable named groups, and replaces loose any typings with a strongly-typed SentryPayload in Sentry helper tests. Project metadata and history files are also updated to reflect these changes. Feedback on the pull request notes that the newly introduced constant TOOL_INCREMENTAL_ITEM_FILTER_OPTION_CONTRACTS is unused and should be removed to clean up dead code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
|
✅ Action performedFull review finished. |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Code Review
This pull request performs source-quality cleanup, including single-sourcing default folder derivation via the type-registry, deduplicating SDK tool option contracts, and replacing loose any typings in Sentry helper tests with a custom SentryPayload type. A review comment suggests changing the SentryPayload definition from Record<string, unknown> to Record<string, any> to prevent TypeScript compilation errors under strict mode when accessing dynamic properties on the payload.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request implements source-quality cleanups and refactoring across the codebase. Specifically, it single-sources custom item default-folder derivation in src/core/store/paths.ts by utilizing toDefaultFolder from the type registry, deduplicates CLI tool option contracts in src/sdk/cli-contracts/tool-option-contracts.ts using named base contract groups, and replaces generic Record<string, any> typings with concrete Sentry types (Event and Breadcrumb) in Sentry helper tests. Additionally, project tracking epics, issues, and history logs are updated to reflect these changes. There are no review comments to address, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request improves code quality and maintainability by single-sourcing custom item default-folder derivation in src/core/store/paths.ts, deduplicating SDK tool option contracts in src/sdk/cli-contracts/tool-option-contracts.ts using shared sub-arrays, and replacing generic Record<string, any> typings with strongly-typed Sentry payloads in Sentry helper tests. Feedback on these changes suggests defining the newly introduced contract arrays as readonly to prevent accidental runtime mutations of shared object references.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Address PR #394 review feedback by keeping shared SDK option-contract helper groups readonly and cloning option contract objects into each exported array. This preserves the public contract array shape while preventing accidental mutation in one export from leaking to sibling command contracts. Add regression coverage for exported list/search/aggregate/dedupe/update-many/close-many contract isolation and record the pm-92if evidence, linked test, changelog check, security scan, audit, and 100/100/100/100 coverage results.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request implements public source-quality cleanups and refactoring. It single-sources custom item default-folder derivation in src/core/store/paths.ts by reusing toDefaultFolder from the type registry. It also deduplicates and refactors SDK tool option contracts in src/sdk/cli-contracts/tool-option-contracts.ts using named readonly contract groups and a cloning helper to prevent accidental shared mutability across exported arrays, backed by a new regression test suite. Additionally, it replaces generic Record<string, any> types with concrete Sentry API types in tests/unit/core/sentry/sentry-helpers.spec.ts. There are no review comments to address, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Add targeted docstrings for the SDK contract cloning helper and its regression-test lookup helper to satisfy the review summary docstring warning without changing executable behavior. Record pm-92if evidence for the docstring cleanup and focused verification gates.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request refactors SDK tool option contracts to deduplicate common option groups and clones them to prevent accidental runtime mutation across exported arrays. It also replaces loose Record<string, any> typings in Sentry helper tests with explicit @sentry/node types, single-sources default folder derivation in store paths, and adds a regression test for contract isolation. Feedback on the new regression test suggests asserting reference inequality directly rather than mutating exported state, which avoids potential side effects and test flakiness.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Address Gemini review feedback by changing the SDK option-contract isolation test to assert object reference inequality instead of mutating exported module state. Record pm-92if evidence for the side-effect-free regression test and focused verification gates.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request refactors and deduplicates SDK tool option contracts, single-sources default-folder derivation, and improves Sentry helper test typings by using explicit Event and Breadcrumb types. It also introduces contract cloning to prevent shared mutability across exported arrays, backed by new regression tests. Feedback points out a redundant double-cloning step in the intermediate TOOL_BASIC_ITEM_FILTER_OPTION_CONTRACTS array that can be simplified.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Address Gemini review feedback by composing the private basic filter group from readonly source arrays directly and retaining cloning only at exported contract array boundaries. Record pm-92if evidence for the focused verification gates.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request refactors the CLI tool option contracts to deduplicate shared contract groups and introduces a cloning mechanism to prevent accidental runtime mutations across exported arrays. It also single-sources custom item default-folder derivation in the store paths module by reusing the type registry's default folder helper, and replaces generic any-based typings with strong Sentry types in the Sentry helper tests. Additionally, a new regression test suite has been added to verify contract object isolation, and project epic, history, and issue tracking files have been updated. No review comments were provided, so there is no additional feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
anycallback payload typings in Sentry helper tests.pm-92if, including file/test links, temp smoke, changelog/package doctor, GitHub security sweep, Sentry/telemetry, and the public-scope deferral note forpm-rj3wignored production telemetry files.Verification
pnpm buildnode scripts/run-tests.mjs test -- tests/unit/core/store/store-paths.spec.ts tests/unit/core/sentry/sentry-helpers.spec.ts tests/unit/commands/contracts-command.spec.ts tests/unit/sdk/sdk-index.spec.ts(4 files / 197 tests)node scripts/run-tests.mjs coverage(256 files / 5138 tests / 100% statements, branches, functions, lines)pnpm typecheckpnpm lintpnpm quality:staticpnpm contracts:checkpnpm security:scanpnpm audit --audit-level moderategit diff --checkpm test pm-92if --run --progress(14/14 sandbox-compatible linked commands)/tmp/tmp.TlcR1qJCP0/work/.agents/pm: init, research preset, customresearch-notetype, Task/custom item create+list, health, validate, andresearch-notes/storage verification.pnpm changelog:pm:checkwithpm-changelog2026.6.27:CHANGELOG.mdunchanged,item_count=1363.pm health --check-only --summary --json: ok, warning_count 0.pm validate --check-resolution --check-history-drift --json: history drift ok; existing resolution metadata backlog remainsvalidate_resolution_missing_fields:258.node dist/cli.js package doctor --project --detail deep --json: ok, zero warnings.node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort: Sentry critical=0 high=0; telemetry finish_error_rate_pct=0.76, failures_without_error_code_rows=0.GitHub / Security Sweep
pnpm audit --audit-level moderate: no known vulnerabilities.RELEASE_PATin the release environment.Notes
node scripts/run-tests.mjs coverageandpnpm contracts:checkare intentionally documented as direct repo gates rather than linked pm tests. The linked-test schema sandbox changes runtime context for those repo-wide checks; the direct current-tree commands pass and are recorded onpm-92if.Summary by Sourcery
Deduplicate shared SDK tool option flag contracts and align store path type folder resolution with the type registry, while tightening Sentry helper test typings and updating pm tracking artifacts.
Enhancements:
Tests:
Summary by cubic
Single-sourced default folders for custom item types through the type registry and deduped SDK tool option contracts with clear, named groups. Exported arrays now clone shared entries only at export boundaries to prevent cross-array mutation; the contract snapshot is unchanged and Sentry test hooks use
@sentry/nodeEvent/Breadcrumb types.toDefaultFolderfor custom item directories.TOOL_*_OPTION_CONTRACTSkeep flag order.@sentry/nodeEvent/Breadcrumb types.Written for commit fc8a438. Summary will update on new commits.