Skip to content

Dedupe SDK option contracts and type folder helpers - #394

Merged
unbraind merged 9 commits into
mainfrom
codex/sdk-contract-source-quality
Jun 28, 2026
Merged

unbraind merged 9 commits into
mainfrom
codex/sdk-contract-source-quality

Conversation

@unbraind

@unbraind unbraind commented Jun 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Reuse the type-registry default-folder primitive from store path resolution so custom item folders are single-sourced.
  • Deduplicate shared SDK tool option contract slices while preserving the generated contract snapshot.
  • Replace unnecessary any callback payload typings in Sentry helper tests.
  • Record pm evidence on pm-92if, including file/test links, temp smoke, changelog/package doctor, GitHub security sweep, Sentry/telemetry, and the public-scope deferral note for pm-rj3w ignored production telemetry files.

Verification

  • pnpm build
  • node 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 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 sandbox-compatible linked commands)
  • Manual temp smoke at /tmp/tmp.TlcR1qJCP0/work/.agents/pm: init, research preset, custom research-note type, Task/custom item create+list, health, validate, and research-notes/ storage verification.
  • pnpm changelog:pm:check with pm-changelog 2026.6.27: CHANGELOG.md unchanged, 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 remains validate_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

  • No open PRs before this branch.
  • No open Dependabot, code scanning, or secret scanning alerts.
  • pnpm audit --audit-level moderate: no known vulnerabilities.
  • Open issue Auto Release blocked: scheduled run failed #374 remains externally blocked on missing RELEASE_PAT in the release environment.

Notes

node scripts/run-tests.mjs coverage and pnpm contracts:check are 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 on pm-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:

  • Introduce shared option contract sets for SDK list, aggregate, dedupe audit, and search tools to centralize common item filter flags.
  • Reuse the type registry default folder helper in store path resolution so custom item type folders are derived from a single source.
  • Refine Sentry helper test callback typings by replacing broad any-based payload types with a dedicated structured payload alias.

Tests:

  • Update pm agent epic, issue, history, and managed-extensions artifacts to record verification and telemetry evidence for pm-92if and pm-rj3w.

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/node Event/Breadcrumb types.

  • Refactors
    • Store paths use toDefaultFolder for custom item directories.
    • Replaced slice-based composition with named base/window/relation groups; TOOL_*_OPTION_CONTRACTS keep flag order.
    • Shared groups are readonly and cloned at export boundaries to avoid leakage and double cloning; added side-effect-free isolation tests.
    • Removed an unused private filter group from the SDK contract helpers.
    • Added docstrings for the cloning helper and test lookup; Sentry helper tests use @sentry/node Event/Breadcrumb types.

Written for commit fc8a438. Summary will update on new commits.

Review in cubic

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.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai

sourcery-ai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This 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 slices

flowchart 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
Loading

File-Level Changes

Change Details Files
Refactor SDK tool option flag contracts to share common item filter slices while preserving existing contract behavior.
  • Introduce TOOL_BASIC_ITEM_FILTER_OPTION_CONTRACTS and TOOL_INCREMENTAL_ITEM_FILTER_OPTION_CONTRACTS as shared filter flag slices.
  • Extract governance-missing and content-presence flag sets into TOOL_GOVERNANCE_MISSING_OPTION_CONTRACTS and TOOL_CONTENT_PRESENCE_OPTION_CONTRACTS.
  • Rebuild TOOL_LIST_FILTER_OPTION_CONTRACTS by composing shared slices plus ids, governance, and content presence flags in the existing order.
  • Update TOOL_AGGREGATE_OPTION_CONTRACTS and TOOL_DEDUPE_AUDIT_OPTION_CONTRACTS to reuse TOOL_BASIC_ITEM_FILTER_OPTION_CONTRACTS.
  • Update TOOL_SEARCH_FILTER_OPTION_CONTRACTS to compose incremental, governance, and content presence slices instead of duplicating definitions.
src/sdk/cli-contracts/tool-option-contracts.ts
Reuse the type registry’s default folder derivation for item type directories to keep folder naming single-sourced.
  • Import toDefaultFolder from the item type registry module into store paths.
  • Remove the local deriveDefaultTypeFolder and toSlugToken helpers from paths.
  • Change getTypeDirPath to call toDefaultFolder when typeToFolder does not provide an override.
src/core/store/paths.ts
Tighten Sentry helper test callback typings by replacing Record<string, any> with a shared payload type.
  • Introduce a SentryPayload type alias as Record<string, unknown> in the Sentry helper tests.
  • Update beforeSend, beforeSendTransaction, and beforeBreadcrumb callback typings to use SentryPayload instead of Record<string, any>.
  • Adjust later ensureSentryInit test expectations to use the SentryPayload-based callback signatures.
tests/unit/core/sentry/sentry-helpers.spec.ts
Record pm evidence and metadata for epic pm-92if and issue pm-rj3w, including extension management and history entries.
  • Update epic pm-92if evidence file to document verification steps and telemetry/gate results.
  • Adjust managed extensions configuration to reflect current extension state for pm.
  • Append history entries for pm-92if and pm-rj3w to capture this change set and telemetry notes.
  • Update pm-rj3w issue metadata to record the public-scope deferral note for ignored production telemetry files.
.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.toon

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updates paths.ts to use toDefaultFolder, refactors shared SDK tool option contract composition, tightens Sentry test hook typings, and refreshes PM tracking metadata files and run records.

Changes

Source Quality Cleanup

Layer / File(s) Summary
Default folder derivation via toDefaultFolder
src/core/store/paths.ts
Adds toDefaultFolder import and replaces the inline default-folder helpers in getTypeDirPath with the imported function.
Tool option contracts deduplication
src/sdk/cli-contracts/tool-option-contracts.ts, tests/unit/sdk/tool-option-contracts.spec.ts
Introduces shared readonly option-contract building blocks, clones them into the exported contract arrays, and adds a test that checks contract objects are not shared across exports.
Sentry test payload type tightening
tests/unit/core/sentry/sentry-helpers.spec.ts
Adds Sentry payload type aliases and updates hook typings in the Sentry helper tests from Record<string, any>.
Agent PM tracking metadata
.agents/pm/epics/pm-92if.toon, .agents/pm/history/pm-92if.jsonl, .agents/pm/history/pm-rj3w.jsonl, .agents/pm/issues/pm-rj3w.toon, .agents/pm/extensions/.managed-extensions.json
Updates epic, history, issue, and extension metadata with new timestamps, comments, tracked files, test matrices, and test run entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • unbraind/pm-cli#285: Uses toDefaultFolder in src/core/store/paths.ts, matching the same default-folder path logic updated here.
  • unbraind/pm-cli#380: Refactors src/sdk/cli-contracts/tool-option-contracts.ts with the same shared-contract deduplication area.
  • unbraind/pm-cli#381: Also restructures tool option contract composition in src/sdk/cli-contracts/tool-option-contracts.ts.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the core refactor: deduplicating SDK option contracts and aligning type-folder helper behavior.
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.
Description check ✅ Passed The description matches the code changes and evidence updates in the pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of this PR now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@greptile-apps

greptile-apps Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR deduplicates two parallel implementations of the same logic: the custom item-type folder derivation in paths.ts now delegates to toDefaultFolder from type-registry.ts, and the flat SDK tool option contract arrays are broken into named, readonly shared groups that are spread+cloned into each exported array.

  • src/core/store/paths.ts: Removes the local deriveDefaultTypeFolder + toSlugToken helpers and replaces the single call site with toDefaultFolder imported from type-registry.ts; the two implementations were identical so behavior is unchanged.
  • src/sdk/cli-contracts/tool-option-contracts.ts: Extracts six named internal groups (TOOL_ITEM_BASE_FILTER_OPTION_CONTRACTS, etc.), clones them per exported array via cloneOptionContracts, and adds readonly on TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACTS; a new isolation test verifies exported arrays do not share object references.
  • tests/unit/core/sentry/sentry-helpers.spec.ts: Replaces Record<string, any> callback typings with @sentry/node's Event and Breadcrumb types for tighter test assertions.

Confidence Score: 5/5

Safe 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

Filename Overview
src/core/store/paths.ts Removes the private deriveDefaultTypeFolder + toSlugToken helpers and delegates to the identical toDefaultFolder from type-registry.ts; the existing getTypeDirPath test suite continues to cover all edge cases.
src/sdk/cli-contracts/tool-option-contracts.ts Deduplicates list/aggregate/dedupe-audit/search option contracts into named readonly groups spread via cloneOptionContracts; element order and set are preserved for every exported array, and TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACTS is now readonly.
tests/unit/sdk/tool-option-contracts.spec.ts New isolation test verifying that exported arrays do not share object references; covers list, search, aggregate, dedupe-audit, update-many, and close-many contracts.
tests/unit/core/sentry/sentry-helpers.spec.ts Replaces Record<string, any> callback typings with @sentry/node Event and Breadcrumb types; no logic changes.

Reviews (9): Last reviewed commit: "chore: avoid intermediate SDK option dou..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between ddd7442 and 2334cc3.

📒 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.toon
  • src/core/store/paths.ts
  • src/sdk/cli-contracts/tool-option-contracts.ts
  • tests/unit/core/sentry/sentry-helpers.spec.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 8 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@codecov

codecov Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 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.
@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of this PR now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of this PR now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of Pull Request #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of Pull Request #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of PR #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
@unbraind

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review
@coderabbitai full review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

@unbraind Re-running a full review of PR #394 now, with attention to the stated objectives and verification notes.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@unbraind
unbraind merged commit ef8f4d6 into main Jun 28, 2026
19 checks passed
@unbraind
unbraind deleted the codex/sdk-contract-source-quality branch June 28, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant