-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: standardize import paths to use @/shared prefix #1456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Standardize import paths in shared package and its consumers to use the @/shared prefix consistently instead of mixing @/, shared/, and @/shared. This improves consistency and makes the module resolution more explicit: - In shared/src files: @/ → @/shared/ - In app files: shared/ → @/shared/ No functional changes, only import path standardization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
WalkthroughConsolidates import paths to the single alias Changes
Possibly related issues
Possibly related PRs
Suggested labels
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-09-04T14:57:04.612ZApplied to files:
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shared/src/lib/utils/container.ts (1)
316-326: Remove unusedchownToparameter—commit scope is import refactoring, not feature addition.The commit message states "migrate away from old import patterns," which should be a pure import refactoring. However, this PR adds an optional
chownToparameter (line 320) and implements new chown logic (lines 355-363) that goes beyond the stated scope.More critically, the new parameter is not used anywhere—all existing callers (
shared/src/lib/utils/container.tsandapp/api/playground/copy-repo/route.ts) omit it entirely. This indicates premature or speculative feature addition rather than a deliberate enhancement needed for this refactoring.Either revert the
chownTochanges to keep the commit focused on imports, or extract them to a separate PR with actual usage.
🧹 Nitpick comments (5)
lib/adapters/PersistingEventBusAdapter.ts (1)
12-14: Import path standardization looks good!The import paths have been correctly updated to use the
@/shared/prefix, aligning with the PR objectives for consistent module resolution.Optional note: Line 13 imports from a barrel file (
@/shared/entities/events/index). Per the coding guidelines, importing directly from the original module path (rather than an index file) would improve tree-shaking and maintain clearer dependency graphs. However, this is outside the scope of this import path refactor and can be addressed in future cleanup work.shared/src/adapters/auth/reader.ts (1)
1-6: LGTM! Import path standardization and type-only imports are correct.The import path changes align perfectly with the PR objective to standardize on
@/shared/prefix. The addition of type-only imports forAuthenticatedUserandAuthReaderPortfollows TypeScript best practices since both are only used in type positions (return types on lines 32 and 34).Optional future refinement:
AccessTokenis also only used in type positions (lines 8, 43) and could benefit from being a type-only import as well. However, keeping the current scope focused on path standardization is reasonable.shared/src/adapters/decorators/timing.ts (1)
1-8: LGTM! Import paths successfully standardized.All import paths have been correctly updated to use the
@/shared/prefix, aligning with the PR's objective to standardize module resolution.Optional: Consider consolidating imports from the same module.
Lines 2 and 3-7 both import from
@/shared/ports/github/issue.writer. For cleaner code organization, they could be combined into a single import statement:Optional refactor to consolidate imports
-import type { Result } from "@/shared/entities/result" -import { Issue } from "@/shared/ports/github/issue.writer" - -import { - type CreateIssueInput, - type GithubIssueErrors, - IssueWriterPort, -} from "@/shared/ports/github/issue.writer" +import type { Result } from "@/shared/entities/result" +import { + Issue, + type CreateIssueInput, + type GithubIssueErrors, + IssueWriterPort, +} from "@/shared/ports/github/issue.writer"lib/utils/container.ts (1)
356-362: Consider parameterizing the chown target for flexibility.The ownership is hardcoded to
root:root. If different container configurations require different ownership (e.g., running as a non-root user), this could cause permission issues. Consider accepting an optionalchownToparameter.Based on the learnings, this can be deferred to a future PR if it's outside the current scope.
🔎 Proposed refactor
export async function copyRepoToExistingContainer({ hostRepoPath, containerName, mountPath = "/workspace", + chownTo = "root:root", }: { hostRepoPath: string containerName: string mountPath?: string + chownTo?: string }): Promise<void> {Then update the chown command:
const chownExec = await container.exec({ - Cmd: ["chown", "-R", "root:root", mountPath], + Cmd: ["chown", "-R", chownTo, mountPath], AttachStdout: true, AttachStderr: true, - User: "root:root", + User: chownTo, })shared/src/lib/utils/utils-common.ts (1)
138-141: Minor typo in error message.The error message contains "occured" which should be "occurred" (double 'r'). However, this appears to be pre-existing code that's only being reformatted in this PR.
🔎 Optional fix for the typo
console.error( - "An unexpected error occured when parsing the repository URL", + "An unexpected error occurred when parsing the repository URL", e )Based on learnings, I understand you prefer to keep PR scope tight and defer non-critical improvements.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (128)
__tests__/shared/usecases/generateBranchName.test.tsapp/api/playground/issue-title-anthropic/route.tsapp/api/sse/route.tsapp/api/workflow/test-event-bus/route.tsapp/playground/components/ResolveIssueCard.tsxapp/workflow-runs/page.tsxapps/workers/workflow-workers/src/handler.tsapps/workers/workflow-workers/src/orchestrators/autoResolveIssue.tsapps/workers/workflow-workers/src/orchestrators/summarizeIssue.tscomponents/issues/controllers/AutoResolveIssueController.tsxcomponents/playground/AutoResolveIssueCard.tsxcomponents/playground/IssueSummaryCard.tsxcomponents/playground/LongRunningWorkflowCard.tsxcomponents/workflow-runs/WorkflowRunsIssueTitlesTableBody.tsxcomponents/workflow-runs/events/StatusUpdate.tsxlib/actions/createIssue.tslib/actions/github.tslib/actions/resolveIssue.tslib/actions/schemas.tslib/actions/workflows/autoResolveIssue.tslib/actions/workflows/createDependentPR.tslib/adapters/BasicLLMAdapter.tslib/adapters/GitHubRefsAdapter.tslib/adapters/PersistingEventBusAdapter.tslib/adapters/github/fetch/issue.reader.tslib/adapters/github/fetch/repository.reader.tslib/agents/DependentPRAgent.tslib/docker.tslib/fetch/github/issues.tslib/github/auth.tslib/github/content.tslib/github/graphql/queries/getPullRequestConflictContext.tslib/github/graphql/queries/listUserRepositories.tslib/github/issues.tslib/github/pullRequests.tslib/github/users.tslib/neo4j/repositories/workflowRun.batch.tslib/neo4j/repositories/workflowRun.tslib/neo4j/services/event.tslib/neo4j/services/plan.tslib/neo4j/services/workflow.tslib/types/index.tslib/utils/container.tslib/webhook/github/handlers/issue/label.autoResolveIssue.handler.tslib/webhook/github/handlers/issue/label.resolve.handler.tslib/workflows/autoResolveIssue.tslib/workflows/commentOnIssue.tslib/workflows/createDependentPR.formatMessage.tslib/workflows/createDependentPR.tsshared/src/adapters/auth/reader.tsshared/src/adapters/decorators/timing.tsshared/src/adapters/github/GitHubRefsAdapter.tsshared/src/adapters/github/IssueReaderAdapter.tsshared/src/adapters/github/octokit/graphql/issue.reader.tsshared/src/adapters/github/octokit/graphql/pullRequest.reader.tsshared/src/adapters/github/octokit/graphql/pullRequest.writer.tsshared/src/adapters/github/octokit/rest/branch.writer.tsshared/src/adapters/github/octokit/rest/issue.reader.tsshared/src/adapters/github/octokit/rest/issue.writer.tsshared/src/adapters/github/octokit/rest/repository.reader.tsshared/src/adapters/ioredis/EventBusAdapter.tsshared/src/adapters/llm/OpenAIAdapter.tsshared/src/adapters/llm/anthropic.tsshared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tsshared/src/entities/Issue.tsshared/src/lib/agents/PlanAndCodeAgent.tsshared/src/lib/agents/base/index.tsshared/src/lib/docker.tsshared/src/lib/git.tsshared/src/lib/github/content.tsshared/src/lib/github/git.tsshared/src/lib/github/graphql/queries/listUserRepositories.tsshared/src/lib/github/index.tsshared/src/lib/github/issues.tsshared/src/lib/github/pullRequests.tsshared/src/lib/github/refs.tsshared/src/lib/github/repos.tsshared/src/lib/github/users.tsshared/src/lib/neo4j/convert.tsshared/src/lib/neo4j/repositories/event.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/neo4j/repositories/workflowRun.tsshared/src/lib/neo4j/services/event.tsshared/src/lib/neo4j/services/plan.tsshared/src/lib/neo4j/services/workflow.tsshared/src/lib/tools/Branch.tsshared/src/lib/tools/Commit.tsshared/src/lib/tools/ContainerExecTool.tsshared/src/lib/tools/CreatePRTool.tsshared/src/lib/tools/FileCheckTool.tsshared/src/lib/tools/GetFileContent.tsshared/src/lib/tools/RipgrepSearchTool.tsshared/src/lib/tools/SetupRepoTool.tsshared/src/lib/tools/SyncBranchTool.tsshared/src/lib/tools/UpdatePRTool.tsshared/src/lib/tools/WriteFileContent.tsshared/src/lib/tools/helper.tsshared/src/lib/types/chat.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/types/docker.tsshared/src/lib/types/github.tsshared/src/lib/types/index.tsshared/src/lib/utils/chat.tsshared/src/lib/utils/cli.tsshared/src/lib/utils/container.tsshared/src/lib/utils/utils-common.tsshared/src/lib/utils/utils-server.tsshared/src/ports/auth/reader.tsshared/src/ports/events/eventBus.tsshared/src/ports/events/publisher.tsshared/src/ports/github/branch.writer.tsshared/src/ports/github/issue.reader.tsshared/src/ports/github/issue.writer.tsshared/src/ports/github/pullRequest.reader.tsshared/src/ports/github/repository.reader.tsshared/src/ports/llm.tsshared/src/ports/repositories/settings.reader.tsshared/src/providers/auth.tsshared/src/services/github/issues.tsshared/src/ui/alert.tsxshared/src/ui/button.tsxshared/src/usecases/git/generateBranchName.tsshared/src/usecases/github/getIssue.tsshared/src/usecases/workflows/autoResolveIssue.tsshared/src/usecases/workflows/generateIssueTitle.tsshared/src/usecases/workflows/resolveIssue.tsshared/src/usecases/workflows/summarizeIssue.tsshared/src/usecases/workflows/testEventInfrastructure.ts
✅ Files skipped from review due to trivial changes (9)
- shared/src/lib/github/index.ts
- lib/adapters/github/fetch/repository.reader.ts
- shared/src/adapters/github/IssueReaderAdapter.ts
- shared/src/lib/github/pullRequests.ts
- shared/src/lib/tools/FileCheckTool.ts
- shared/src/services/github/issues.ts
- shared/src/lib/types/docker.ts
- shared/src/lib/github/repos.ts
- lib/github/issues.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,mts,mjs}
📄 CodeRabbit inference engine (.cursor/rules/code-structure.mdc)
Avoid barrel files: do not create files whose sole purpose is to re-export symbols from multiple modules; prefer importing from original module paths to maintain clear dependency graphs and better tree-shaking
Files:
__tests__/shared/usecases/generateBranchName.test.tsshared/src/adapters/github/octokit/rest/repository.reader.tsshared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tslib/neo4j/repositories/workflowRun.batch.tsshared/src/ports/github/repository.reader.tsshared/src/lib/types/chat.tsshared/src/ui/alert.tsxapps/workers/workflow-workers/src/handler.tsshared/src/lib/tools/CreatePRTool.tsshared/src/adapters/llm/anthropic.tsshared/src/lib/tools/Branch.tscomponents/playground/AutoResolveIssueCard.tsxshared/src/ports/github/pullRequest.reader.tsshared/src/lib/tools/UpdatePRTool.tsshared/src/lib/types/github.tsshared/src/ports/events/publisher.tsshared/src/usecases/github/getIssue.tslib/actions/schemas.tsshared/src/ports/events/eventBus.tscomponents/workflow-runs/WorkflowRunsIssueTitlesTableBody.tsxshared/src/ui/button.tsxlib/actions/createIssue.tsshared/src/lib/github/git.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tslib/adapters/github/fetch/issue.reader.tsshared/src/adapters/github/octokit/rest/issue.reader.tslib/github/users.tsapps/workers/workflow-workers/src/orchestrators/autoResolveIssue.tsshared/src/usecases/workflows/autoResolveIssue.tsshared/src/lib/tools/RipgrepSearchTool.tslib/webhook/github/handlers/issue/label.autoResolveIssue.handler.tsshared/src/lib/tools/SyncBranchTool.tsshared/src/adapters/llm/OpenAIAdapter.tsshared/src/usecases/workflows/summarizeIssue.tsshared/src/adapters/decorators/timing.tslib/workflows/createDependentPR.tslib/docker.tsshared/src/usecases/workflows/generateIssueTitle.tslib/agents/DependentPRAgent.tsshared/src/lib/tools/GetFileContent.tslib/github/pullRequests.tslib/adapters/BasicLLMAdapter.tsshared/src/lib/utils/utils-server.tsshared/src/adapters/ioredis/EventBusAdapter.tsshared/src/ports/github/issue.writer.tsshared/src/usecases/workflows/testEventInfrastructure.tsshared/src/lib/neo4j/repositories/event.tsshared/src/ports/auth/reader.tslib/actions/workflows/createDependentPR.tslib/github/auth.tsshared/src/adapters/auth/reader.tsshared/src/adapters/github/octokit/graphql/pullRequest.reader.tsapp/api/playground/issue-title-anthropic/route.tsshared/src/lib/types/index.tsshared/src/adapters/github/octokit/graphql/pullRequest.writer.tsshared/src/lib/neo4j/convert.tsshared/src/lib/utils/cli.tsshared/src/lib/tools/WriteFileContent.tsshared/src/adapters/github/octokit/graphql/issue.reader.tsshared/src/lib/agents/base/index.tslib/adapters/PersistingEventBusAdapter.tsshared/src/lib/utils/chat.tslib/types/index.tsshared/src/lib/utils/utils-common.tslib/workflows/commentOnIssue.tsapp/api/workflow/test-event-bus/route.tsshared/src/lib/tools/Commit.tslib/workflows/createDependentPR.formatMessage.tsapp/workflow-runs/page.tsxlib/workflows/autoResolveIssue.tsshared/src/lib/utils/container.tslib/actions/resolveIssue.tscomponents/playground/LongRunningWorkflowCard.tsxshared/src/lib/github/users.tscomponents/playground/IssueSummaryCard.tsxshared/src/entities/Issue.tsshared/src/usecases/git/generateBranchName.tsshared/src/adapters/github/octokit/rest/issue.writer.tsshared/src/usecases/workflows/resolveIssue.tsshared/src/lib/tools/helper.tsshared/src/lib/agents/PlanAndCodeAgent.tslib/github/graphql/queries/getPullRequestConflictContext.tsapp/playground/components/ResolveIssueCard.tsxshared/src/lib/tools/ContainerExecTool.tsshared/src/lib/github/graphql/queries/listUserRepositories.tslib/github/graphql/queries/listUserRepositories.tslib/utils/container.tslib/github/content.tscomponents/issues/controllers/AutoResolveIssueController.tsxlib/adapters/GitHubRefsAdapter.tslib/fetch/github/issues.tsshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/workflow.tsapps/workers/workflow-workers/src/orchestrators/summarizeIssue.tsshared/src/ports/github/branch.writer.tslib/actions/github.tslib/neo4j/services/event.tsshared/src/lib/git.tsshared/src/ports/llm.tsshared/src/ports/github/issue.reader.tsapp/api/sse/route.tslib/webhook/github/handlers/issue/label.resolve.handler.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/github/refs.tslib/actions/workflows/autoResolveIssue.tsshared/src/ports/repositories/settings.reader.tsshared/src/lib/types/db/neo4j.tsshared/src/adapters/github/GitHubRefsAdapter.tsshared/src/lib/neo4j/services/plan.tsshared/src/lib/tools/SetupRepoTool.tsshared/src/lib/github/content.tsshared/src/lib/docker.tsshared/src/lib/neo4j/services/event.tscomponents/workflow-runs/events/StatusUpdate.tsxlib/neo4j/services/plan.tsshared/src/lib/github/issues.tsshared/src/providers/auth.tsshared/src/adapters/github/octokit/rest/branch.writer.ts
🧠 Learnings (19)
📓 Common learnings
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: shared/src/ports/events/publisher.ts:16-19
Timestamp: 2025-09-22T09:24:26.840Z
Learning: youngchingjui prefers to manage PR scope tightly and defer technical debt improvements to future PRs rather than expanding the current PR's scope, even for related consistency issues.
📚 Learning: 2025-09-04T14:57:04.612Z
Learnt from: CR
Repo: youngchingjui/issue-to-pr PR: 0
File: .cursor/rules/code-structure.mdc:0-0
Timestamp: 2025-09-04T14:57:04.612Z
Learning: Applies to **/*.{ts,tsx,js,jsx,mts,mjs} : Avoid barrel files: do not create files whose sole purpose is to re-export symbols from multiple modules; prefer importing from original module paths to maintain clear dependency graphs and better tree-shaking
Applied to files:
__tests__/shared/usecases/generateBranchName.test.tsshared/src/lib/tools/CreatePRTool.tsshared/src/lib/tools/Branch.tsshared/src/lib/tools/UpdatePRTool.tsshared/src/ports/events/publisher.tslib/actions/createIssue.tsshared/src/lib/tools/SyncBranchTool.tsshared/src/lib/tools/WriteFileContent.tslib/actions/resolveIssue.tsshared/src/usecases/git/generateBranchName.tsshared/src/adapters/github/octokit/rest/branch.writer.ts
📚 Learning: 2025-09-22T09:28:41.886Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: lib/adapters/PersistingEventBusAdapter.ts:55-58
Timestamp: 2025-09-22T09:28:41.886Z
Learning: The project is migrating away from neo4j/services/event adapters, so issues in files like lib/adapters/PersistingEventBusAdapter.ts that use these adapters may be temporary and lower priority.
Applied to files:
shared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tsapps/workers/workflow-workers/src/handler.tsshared/src/ports/events/publisher.tsshared/src/ports/events/eventBus.tslib/actions/createIssue.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/adapters/github/fetch/issue.reader.tsapps/workers/workflow-workers/src/orchestrators/autoResolveIssue.tsshared/src/usecases/workflows/autoResolveIssue.tsshared/src/adapters/decorators/timing.tslib/adapters/BasicLLMAdapter.tsshared/src/adapters/ioredis/EventBusAdapter.tsshared/src/usecases/workflows/testEventInfrastructure.tsshared/src/lib/neo4j/repositories/event.tslib/actions/workflows/createDependentPR.tsshared/src/adapters/auth/reader.tsshared/src/lib/neo4j/convert.tsshared/src/lib/agents/base/index.tslib/adapters/PersistingEventBusAdapter.tslib/workflows/commentOnIssue.tsapp/api/workflow/test-event-bus/route.tslib/workflows/autoResolveIssue.tslib/actions/resolveIssue.tsshared/src/adapters/github/octokit/rest/issue.writer.tslib/adapters/GitHubRefsAdapter.tsshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/event.tslib/webhook/github/handlers/issue/label.resolve.handler.tsshared/src/lib/neo4j/repositories/plan.tslib/actions/workflows/autoResolveIssue.tsshared/src/adapters/github/GitHubRefsAdapter.tsshared/src/lib/neo4j/services/plan.tsshared/src/lib/neo4j/services/event.ts
📚 Learning: 2026-01-02T09:20:53.213Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1450
File: shared/src/adapters/neo4j/types.ts:272-283
Timestamp: 2026-01-02T09:20:53.213Z
Learning: The plan schema and llmResponseWithPlanSchema in shared/src/adapters/neo4j/types.ts are being migrated away/deprecated, so schema inconsistencies related to plan support do not need to be fixed.
Applied to files:
shared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tsshared/src/adapters/llm/anthropic.tslib/actions/schemas.tsshared/src/lib/neo4j/repositories/workflowRun.tsshared/src/adapters/llm/OpenAIAdapter.tslib/adapters/BasicLLMAdapter.tsshared/src/lib/neo4j/repositories/event.tsshared/src/lib/neo4j/convert.tsshared/src/lib/agents/base/index.tsshared/src/lib/agents/PlanAndCodeAgent.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/neo4j/services/plan.tslib/neo4j/services/plan.ts
📚 Learning: 2025-09-22T09:34:43.580Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: lib/neo4j/convert.ts:69-74
Timestamp: 2025-09-22T09:34:43.580Z
Learning: The file lib/neo4j/convert.ts is being moved away from/deprecated, so fixes in this file may not be worth implementing since it will be replaced.
Applied to files:
shared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tslib/neo4j/repositories/workflowRun.batch.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tslib/github/users.tslib/docker.tsshared/src/lib/neo4j/repositories/event.tslib/actions/workflows/createDependentPR.tsshared/src/lib/neo4j/convert.tsshared/src/lib/agents/base/index.tslib/adapters/PersistingEventBusAdapter.tsshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/workflow.tslib/neo4j/services/event.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/neo4j/services/plan.tsshared/src/lib/neo4j/services/event.tslib/neo4j/services/plan.ts
📚 Learning: 2025-09-22T09:33:51.194Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: lib/neo4j/services/event.ts:365-370
Timestamp: 2025-09-22T09:33:51.194Z
Learning: The file lib/neo4j/services/event.ts is planned for migration/deprecation, so minor fixes may not be worth implementing since the file will be replaced.
Applied to files:
shared/src/adapters/neo4j/repositories/SettingsReaderAdapter.tslib/neo4j/repositories/workflowRun.batch.tsshared/src/ports/events/publisher.tsshared/src/ports/events/eventBus.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tsshared/src/adapters/ioredis/EventBusAdapter.tsshared/src/usecases/workflows/testEventInfrastructure.tsshared/src/lib/neo4j/repositories/event.tsshared/src/lib/neo4j/convert.tsshared/src/lib/agents/base/index.tslib/adapters/PersistingEventBusAdapter.tslib/workflows/commentOnIssue.tsapp/api/workflow/test-event-bus/route.tsshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/workflow.tslib/neo4j/services/event.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/neo4j/services/plan.tsshared/src/lib/neo4j/services/event.tslib/neo4j/services/plan.ts
📚 Learning: 2026-01-02T09:21:36.652Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1450
File: shared/src/adapters/neo4j/types.ts:12-17
Timestamp: 2026-01-02T09:21:36.652Z
Learning: In the Neo4j data model at shared/src/adapters/neo4j/types.ts, the WorkflowRun node intentionally does not include a `state` field. The workflow run state is derived from the chain of events rather than being stored directly on the WorkflowRun node, following an event sourcing pattern where state is computed by replaying events.
Applied to files:
lib/neo4j/repositories/workflowRun.batch.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tsshared/src/lib/neo4j/repositories/event.tsapp/api/workflow/test-event-bus/route.tscomponents/playground/LongRunningWorkflowCard.tsxshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/workflow.tslib/neo4j/services/event.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/neo4j/services/event.tscomponents/workflow-runs/events/StatusUpdate.tsx
📚 Learning: 2025-09-10T06:22:04.642Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1223
File: components/RepositoryList.tsx:0-0
Timestamp: 2025-09-10T06:22:04.642Z
Learning: Repository links in RepositoryList.tsx should use repo.full_name to construct paths (e.g., `/${repo.full_name}/issues`) instead of manually combining owner and repository name, as this ensures correct routing for both personal and organization repositories.
Applied to files:
shared/src/ports/github/repository.reader.tslib/actions/createIssue.tsshared/src/lib/utils/utils-common.tsshared/src/lib/github/graphql/queries/listUserRepositories.tslib/actions/github.tsshared/src/ports/github/issue.reader.ts
📚 Learning: 2025-09-22T09:32:04.764Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: lib/types/db/neo4j.ts:89-91
Timestamp: 2025-09-22T09:32:04.764Z
Learning: The new WorkflowStateEventSchema in shared/src/entities/events/WorkflowEvent.ts does not contain a workflowId field, so DB-level schemas should not attempt to omit it when using this schema.
Applied to files:
apps/workers/workflow-workers/src/handler.tsshared/src/ports/events/eventBus.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tsshared/src/usecases/workflows/testEventInfrastructure.tsshared/src/lib/neo4j/repositories/event.tsshared/src/lib/types/index.tslib/types/index.tslib/workflows/commentOnIssue.tscomponents/playground/LongRunningWorkflowCard.tsxshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/event.tsshared/src/lib/neo4j/repositories/plan.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/neo4j/services/event.tscomponents/workflow-runs/events/StatusUpdate.tsx
📚 Learning: 2025-09-22T09:32:04.764Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: lib/types/db/neo4j.ts:89-91
Timestamp: 2025-09-22T09:32:04.764Z
Learning: The new WorkflowStateEventSchema in shared/src/entities/events/WorkflowEvent.ts is built from BaseFields (id, timestamp) and does not contain a workflowId field, so DB-level schemas should not attempt to omit workflowId when using this schema.
Applied to files:
apps/workers/workflow-workers/src/handler.tsshared/src/ports/events/eventBus.tsshared/src/lib/neo4j/repositories/workflowRun.tslib/neo4j/repositories/workflowRun.tsshared/src/usecases/workflows/testEventInfrastructure.tsshared/src/lib/neo4j/repositories/event.tsshared/src/lib/types/index.tslib/types/index.tslib/workflows/commentOnIssue.tsapp/api/workflow/test-event-bus/route.tscomponents/playground/LongRunningWorkflowCard.tsxcomponents/playground/IssueSummaryCard.tsxshared/src/lib/neo4j/services/workflow.tslib/neo4j/services/event.tsshared/src/lib/types/db/neo4j.tsshared/src/lib/neo4j/services/event.tscomponents/workflow-runs/events/StatusUpdate.tsx
📚 Learning: 2025-09-22T09:32:07.272Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: shared/src/entities/events/WorkflowEvent.ts:15-20
Timestamp: 2025-09-22T09:32:07.272Z
Learning: For workflow.started events in shared/src/entities/events/WorkflowEvent.ts, the content field is intentionally optional, not required. The schema correctly uses z.string().optional().
Applied to files:
apps/workers/workflow-workers/src/handler.tsshared/src/lib/types/index.tslib/types/index.tslib/neo4j/services/event.ts
📚 Learning: 2025-09-11T09:11:14.319Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1214
File: lib/webhook.ts:184-189
Timestamp: 2025-09-11T09:11:14.319Z
Learning: The autoResolveIssue workflow signature is autoResolveIssue(params, ports) where params contains {issue, repository, jobId} and ports contains {auth: AuthReaderPort, settings: SettingsReaderPort, eventBus?: EventBusPort}.
Applied to files:
apps/workers/workflow-workers/src/handler.tsapps/workers/workflow-workers/src/orchestrators/autoResolveIssue.tsshared/src/usecases/workflows/autoResolveIssue.tslib/webhook/github/handlers/issue/label.autoResolveIssue.handler.tslib/workflows/autoResolveIssue.tslib/actions/resolveIssue.tsshared/src/usecases/workflows/resolveIssue.tscomponents/issues/controllers/AutoResolveIssueController.tsxlib/actions/workflows/autoResolveIssue.ts
📚 Learning: 2025-09-04T14:58:54.915Z
Learnt from: CR
Repo: youngchingjui/issue-to-pr PR: 0
File: .cursor/rules/git-management.mdc:0-0
Timestamp: 2025-09-04T14:58:54.915Z
Learning: Can create and update pull requests through GitHub API when requested
Applied to files:
shared/src/lib/tools/CreatePRTool.tsshared/src/lib/tools/UpdatePRTool.tslib/agents/DependentPRAgent.tsshared/src/adapters/github/octokit/graphql/pullRequest.writer.ts
📚 Learning: 2025-09-11T09:11:14.319Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1214
File: lib/webhook.ts:184-189
Timestamp: 2025-09-11T09:11:14.319Z
Learning: The autoResolveIssue workflow in the codebase follows clean architecture principles with a two-argument signature: autoResolveIssue(params, ports), where ports contains auth and settings adapters.
Applied to files:
apps/workers/workflow-workers/src/orchestrators/autoResolveIssue.tsshared/src/usecases/workflows/autoResolveIssue.tslib/webhook/github/handlers/issue/label.autoResolveIssue.handler.tslib/workflows/autoResolveIssue.tslib/actions/resolveIssue.tsshared/src/entities/Issue.tsshared/src/usecases/workflows/resolveIssue.tscomponents/issues/controllers/AutoResolveIssueController.tsxlib/actions/workflows/autoResolveIssue.ts
📚 Learning: 2025-09-12T01:44:51.070Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1241
File: app/api/webhook/github/route.ts:85-90
Timestamp: 2025-09-12T01:44:51.070Z
Learning: In the webhook handlers at app/api/webhook/github/route.ts, runWithInstallationId is intentionally not awaited to allow fire-and-forget background processing of long-running workflows, avoiding webhook timeouts. The team plans to migrate these to proper queues/workers in a separate issue later.
Applied to files:
lib/webhook/github/handlers/issue/label.autoResolveIssue.handler.tsshared/src/lib/utils/utils-server.tsapp/workflow-runs/page.tsxlib/webhook/github/handlers/issue/label.resolve.handler.ts
📚 Learning: 2025-09-12T02:32:22.420Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1241
File: lib/webhook/handlers/pullRequestHandler.ts:34-41
Timestamp: 2025-09-12T02:32:22.420Z
Learning: When fixing command injection vulnerabilities in Docker operations, replace shell-based commands like `docker ps --filter "label=${userInput}"` with dockerode API calls using the filters object parameter. This completely eliminates injection risks by avoiding shell interpolation of user-controlled data.
Applied to files:
lib/docker.tsshared/src/lib/utils/cli.tsshared/src/lib/docker.ts
📚 Learning: 2025-09-04T14:57:28.594Z
Learnt from: CR
Repo: youngchingjui/issue-to-pr PR: 0
File: .cursor/rules/container-use.mdc:0-0
Timestamp: 2025-09-04T14:57:28.594Z
Learning: If the user requests git interactions, inform them that git is not supported within the container environment and that changes are automatically propagated to their container-use git remote.
Applied to files:
lib/docker.ts
📚 Learning: 2025-09-04T14:57:28.594Z
Learnt from: CR
Repo: youngchingjui/issue-to-pr PR: 0
File: .cursor/rules/container-use.mdc:0-0
Timestamp: 2025-09-04T14:57:28.594Z
Learning: Avoid running other git commands in the container; they will not work as expected because each container workdir is an isolated worktree.
Applied to files:
lib/docker.ts
📚 Learning: 2025-09-10T07:15:30.472Z
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1231
File: lib/agents/DependentPRAgent.ts:61-61
Timestamp: 2025-09-10T07:15:30.472Z
Learning: In lib/agents/DependentPRAgent.ts, the constructor uses `super({ model: "gpt-5", ...base })` intentionally to allow base.model to override "gpt-5" if needed. GPT-5 should be treated as the default model, not enforced, to maintain flexibility for future use cases.
Applied to files:
lib/agents/DependentPRAgent.ts
🧬 Code graph analysis (1)
shared/src/lib/utils/utils-common.ts (3)
lib/utils/utils-common.ts (1)
getRepoFullNameFromIssue(108-139)shared/src/lib/types/github.ts (2)
GitHubIssue(10-10)PullRequest(19-19)lib/types/github.ts (2)
GitHubIssue(10-10)PullRequest(19-19)
| import { writeFileInContainer } from "@/shared/lib/docker" | ||
| import { writeFile } from "@/shared/lib/fs" | ||
| import { createTool } from "@/shared/lib/tools/helper" | ||
| import { | ||
| asRepoEnvironment, | ||
| type RepoEnvironment, | ||
| type Tool, | ||
| } from "@/shared/lib/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the structure of the imported modules
echo "=== Checking imported module structures ==="
# Check what's exported from @/shared/lib/docker
echo -e "\n--- shared/src/lib/docker structure ---"
fd . shared/src/lib/docker --max-depth 2 -t f
# Check what's exported from @/shared/lib/fs
echo -e "\n--- shared/src/lib/fs structure ---"
fd . shared/src/lib/fs --max-depth 2 -t f
# Check what's exported from @/shared/lib/tools/helper
echo -e "\n--- shared/src/lib/tools/helper structure ---"
fd . shared/src/lib/tools/helper --max-depth 2 -t f
# Check what's exported from @/shared/lib/types
echo -e "\n--- shared/src/lib/types structure ---"
fd . shared/src/lib/types --max-depth 2 -t fRepository: youngchingjui/issue-to-pr
Length of output: 194
🏁 Script executed:
# Check the WriteFileContent.ts file itself
echo "=== WriteFileContent.ts content ==="
cat -n shared/src/lib/tools/WriteFileContent.ts | head -50Repository: youngchingjui/issue-to-pr
Length of output: 1857
🏁 Script executed:
# Check if any of the imported paths are barrel files (index.ts, index.js)
echo "=== Checking for barrel files in imported paths ==="
fd 'index\.(ts|tsx|js|jsx)$' shared/src/lib/docker
fd 'index\.(ts|tsx|js|jsx)$' shared/src/lib/fs
fd 'index\.(ts|tsx|js|jsx)$' shared/src/lib/tools
fd 'index\.(ts|tsx|js|jsx)$' shared/src/lib/typesRepository: youngchingjui/issue-to-pr
Length of output: 381
🏁 Script executed:
# Check tsconfig to verify path aliases
echo "=== Checking tsconfig for path aliases ==="
find . -maxdepth 2 -name 'tsconfig*.json' -type f | head -5Repository: youngchingjui/issue-to-pr
Length of output: 197
🏁 Script executed:
# Let's explore the actual structure of shared/src/lib
echo "=== Exploring shared/src/lib structure ==="
fd . shared/src/lib --max-depth 3 -t f | head -30
echo -e "\n=== Files matching docker ==="
fd 'docker' shared/src/lib
echo -e "\n=== Files matching fs ==="
fd 'fs' shared/src/libRepository: youngchingjui/issue-to-pr
Length of output: 1284
🏁 Script executed:
# Check the actual exports from the types barrel file
echo "=== Content of shared/src/lib/types/index.ts ==="
cat shared/src/lib/types/index.ts | head -50Repository: youngchingjui/issue-to-pr
Length of output: 1402
🏁 Script executed:
# Search for where WriteFileContent is imported from in the codebase
echo "=== Files importing WriteFileContent ==="
rg -l 'from.*WriteFileContent' --type ts --type tsxRepository: youngchingjui/issue-to-pr
Length of output: 154
🏁 Script executed:
# Check imports that use the patterns in the coding guidelines
echo "=== Checking import patterns in codebase ==="
rg '@/shared/lib/[a-zA-Z]+' --type ts --type tsx -o | sort | uniqRepository: youngchingjui/issue-to-pr
Length of output: 158
🏁 Script executed:
# Let's search for imports without type flags
echo "=== Files importing WriteFileContent ==="
rg 'from.*WriteFileContent' --type-list
rg 'from.*WriteFileContent'Repository: youngchingjui/issue-to-pr
Length of output: 1188
🏁 Script executed:
# Check if helper file exists and where
echo "=== Finding helper file ==="
fd 'helper' shared/src/lib/tools
# List all files in tools directory
echo -e "\n=== Files in shared/src/lib/tools ==="
ls -la shared/src/lib/tools/ | head -20Repository: youngchingjui/issue-to-pr
Length of output: 1060
🏁 Script executed:
# Check the full content of types/index.ts to see all exports
echo "=== Full types/index.ts to find RepoEnvironment and asRepoEnvironment ==="
cat shared/src/lib/types/index.ts | grep -E '(RepoEnvironment|asRepoEnvironment|export)' -A 2 -B 2Repository: youngchingjui/issue-to-pr
Length of output: 5388
🏁 Script executed:
# Verify the actual structure - is types a direct file or directory with index?
echo "=== Checking types structure ==="
ls -la shared/src/lib/types/ 2>/dev/null || echo "types is a file"
file shared/src/lib/types*Repository: youngchingjui/issue-to-pr
Length of output: 615
🏁 Script executed:
# Check if RepoEnvironment and Tool are defined in index.ts or separate files
echo "=== Checking if RepoEnvironment and Tool are in separate files ==="
rg 'export type RepoEnvironment|export interface Tool' shared/src/lib/types/
echo -e "\n=== Checking for separate definition files in types directory ==="
ls -la shared/src/lib/types/
cat shared/src/lib/types/*.ts | grep -E 'export (type|interface) (RepoEnvironment|Tool)'Repository: youngchingjui/issue-to-pr
Length of output: 1006
🏁 Script executed:
# Count standardization status - how many files use old vs new pattern
echo "=== Standardization status ==="
echo "Old pattern (@/lib/):"
rg 'from.*@/lib/tools/WriteFileContent' | wc -l
echo "New pattern (@/shared/lib/):"
rg 'from.*@/shared/lib/tools/WriteFileContent' | wc -lRepository: youngchingjui/issue-to-pr
Length of output: 154
Incomplete standardization and unaddressed barrel file import pattern.
The imports in lines 4-11 have been updated to use @/shared/lib/ paths, but this is a partial refactor. Five other files in the codebase still import createWriteFileContentTool using the old @/lib/tools/WriteFileContent pattern (lib/workflows/resolveIssue.ts, lib/agents/MergeConflictResolverAgent.ts, lib/agents/DependentPRAgent.ts, lib/agents/PlanAndCodeAgent.ts, and tests/lib/agents/resolveIssue.llm.test.ts). These must also be updated to complete the standardization.
Additionally, the imports from @/shared/lib/types point to a barrel file (types/index.ts) that aggregates multiple exports. Per the coding guidelines, prefer importing from original module paths rather than barrel files to maintain clear dependency graphs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/storybook/src/stories/Microphone.stories.tsx (1)
67-79: Button rendering simplification extends beyond import standardization.While the refactored button rendering is cleaner and functionally equivalent, this change goes beyond the stated PR scope of "standardizing import paths." The original multi-line map worked correctly.
This is a reasonable simplification, but consider keeping such refinements separate from pure import path changes to maintain focused PR scope, consistent with the project's preference for tight PR boundaries.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
apps/openai-realtime-agents/tsconfig.jsonapps/storybook/.storybook/main.tsapps/storybook/src/stories/Button.tsxapps/storybook/src/stories/IssueRow.stories.tsxapps/storybook/src/stories/Microphone.stories.tsxapps/storybook/src/stories/SharedButton.stories.tsxapps/storybook/src/stories/TableAddRowSkeleton.stories.tsxapps/storybook/tsconfig.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,mts,mjs}
📄 CodeRabbit inference engine (.cursor/rules/code-structure.mdc)
Avoid barrel files: do not create files whose sole purpose is to re-export symbols from multiple modules; prefer importing from original module paths to maintain clear dependency graphs and better tree-shaking
Files:
apps/storybook/src/stories/Microphone.stories.tsxapps/storybook/src/stories/SharedButton.stories.tsxapps/storybook/src/stories/Button.tsxapps/storybook/src/stories/IssueRow.stories.tsxapps/storybook/src/stories/TableAddRowSkeleton.stories.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1223
File: components/RepositoryList.tsx:0-0
Timestamp: 2025-09-10T06:22:04.642Z
Learning: Repository links in RepositoryList.tsx should use repo.full_name to construct paths (e.g., `/${repo.full_name}/issues`) instead of manually combining owner and repository name, as this ensures correct routing for both personal and organization repositories.
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: shared/src/ports/events/publisher.ts:16-19
Timestamp: 2025-09-22T09:24:26.840Z
Learning: youngchingjui prefers to manage PR scope tightly and defer technical debt improvements to future PRs rather than expanding the current PR's scope, even for related consistency issues.
📚 Learning: 2025-09-04T14:57:04.612Z
Learnt from: CR
Repo: youngchingjui/issue-to-pr PR: 0
File: .cursor/rules/code-structure.mdc:0-0
Timestamp: 2025-09-04T14:57:04.612Z
Learning: Applies to **/*.{ts,tsx,js,jsx,mts,mjs} : Avoid barrel files: do not create files whose sole purpose is to re-export symbols from multiple modules; prefer importing from original module paths to maintain clear dependency graphs and better tree-shaking
Applied to files:
apps/storybook/tsconfig.json
🧬 Code graph analysis (1)
apps/storybook/src/stories/SharedButton.stories.tsx (1)
apps/storybook/src/stories/Button.tsx (1)
Button(17-35)
🔇 Additional comments (8)
apps/storybook/tsconfig.json (1)
8-8: LGTM! Path alias correctly updated.The TypeScript path mapping has been properly updated to align with the standardized
@/shared/*import pattern.apps/storybook/src/stories/Microphone.stories.tsx (1)
4-4: LGTM! Import path correctly standardized.The import has been properly updated from
@shared/ui/Microphoneto@/shared/ui/Microphone, aligning with the repository-wide standardization effort.apps/storybook/src/stories/IssueRow.stories.tsx (1)
4-4: LGTM! Import path correctly standardized.The import path has been properly updated from
@shared/ui/IssueRowto@/shared/ui/IssueRow, consistent with the repository-wide alias standardization.apps/storybook/.storybook/main.ts (1)
32-32: LGTM! New alias mapping added correctly.The
@/sharedalias has been properly configured to resolve toshared/src, enabling the standardized import pattern in Storybook stories. Note that the legacysharedalias (line 31) remains in place, allowing for a gradual migration or backward compatibility.apps/openai-realtime-agents/tsconfig.json (1)
20-20: LGTM! Path alias standardization looks correct.The change from
"@shared/*"to"@/shared/*"aligns perfectly with the PR objective to standardize import paths across the repository.apps/storybook/src/stories/Button.tsx (1)
29-29: This styling change appears unrelated to the PR objective.The PR summary states this is a pure refactor to standardize import paths to
@/shared, but this line changes the styling implementation from styled-jsx to an inline React style prop. This change is not mentioned in the PR description and doesn't relate to import path standardization.Consider moving this to a separate PR focused on styling refactors, or update the PR description to include this change.
Based on learnings, you prefer to manage PR scope tightly and defer unrelated changes to future PRs.
apps/storybook/src/stories/SharedButton.stories.tsx (2)
5-5: LGTM! Import path standardization is correct.The change from
"@shared/ui/button"to"@/shared/ui/button"aligns with the PR objective to standardize on the@/sharedprefix.
1-1: Multiple unrelated changes appear in this file.This file includes several changes beyond import path standardization:
- Line 1: Changed from
@storybook/reactto@storybook/nextjs- this is a Storybook adapter change unrelated to import paths- Line 3: React import reordered - style/formatting change unrelated to import paths
- Lines 24-86: JSX formatting changes (button children wrapped across multiple lines) - formatting changes unrelated to import paths
Only line 5 (the
@/shared/ui/buttonimport) relates to the stated PR objective of standardizing import paths. Consider either updating the PR description to document these additional changes or moving them to separate PRs.Based on learnings, you prefer to manage PR scope tightly and defer unrelated improvements to future PRs.
Also applies to: 3-3, 24-86
| @@ -1,5 +1,6 @@ | |||
| import type { Meta, StoryObj } from "@storybook/react" | |||
| import type { Meta, StoryObj } from "@storybook/nextjs" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all story files in the storybook app
echo "=== Story files in apps/storybook ==="
find apps/storybook -name "*.stories.ts*" -type f
echo ""
echo "=== Checking Storybook framework imports in story files ==="
# Search for any @storybook/ imports in story files
find apps/storybook -name "*.stories.ts*" -type f -exec grep -H "@storybook/" {} \;
echo ""
echo "=== Checking for @storybook/react imports specifically ==="
find apps/storybook -name "*.stories.ts*" -type f -exec grep -H "@storybook/react" {} \;
echo ""
echo "=== Checking for @storybook/nextjs imports specifically ==="
find apps/storybook -name "*.stories.ts*" -type f -exec grep -H "@storybook/nextjs" {} \;Repository: youngchingjui/issue-to-pr
Length of output: 2654
Address inconsistent Storybook framework imports across story files.
The import change to @storybook/nextjs is consistent with other .tsx story files, but the codebase uses mixed frameworks: 6 files import from @storybook/nextjs while 3 files (Button.stories.ts, Header.stories.ts, Page.stories.ts) import from @storybook/nextjs-vite. Ensure this framework split is intentional and that all stories render correctly with their respective configurations. If unintentional, standardize to a single Storybook framework across all stories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
apps/workers/workflow-workers/package.jsonpackage.jsonshared/package.jsonshared/src/lib/agents/base/index.ts
💤 Files with no reviewable changes (1)
- package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- shared/src/lib/agents/base/index.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1223
File: components/RepositoryList.tsx:0-0
Timestamp: 2025-09-10T06:22:04.642Z
Learning: Repository links in RepositoryList.tsx should use repo.full_name to construct paths (e.g., `/${repo.full_name}/issues`) instead of manually combining owner and repository name, as this ensures correct routing for both personal and organization repositories.
Learnt from: youngchingjui
Repo: youngchingjui/issue-to-pr PR: 1282
File: shared/src/ports/events/publisher.ts:16-19
Timestamp: 2025-09-22T09:24:26.840Z
Learning: youngchingjui prefers to manage PR scope tightly and defer technical debt improvements to future PRs rather than expanding the current PR's scope, even for related consistency issues.
🔇 Additional comments (2)
apps/workers/workflow-workers/package.json (2)
13-22: Verify that removing thesharedworkspace dependency doesn't break module resolution.The removal of
shared: "workspace:*"needs verification. While the PR standardizes imports to use the@/sharedalias, TypeScript path mappings alone don't guarantee runtime module resolution in Node.js—the actual workspace dependency typically needs to remain inpackage.jsonfor the module to be resolved correctly. Confirm whether workflow-workers imports from the shared workspace before removing this dependency.
13-14: This file is newly created as part of migrating away from the shared package—the dependencies listed (includinglangfuse,langfuse-core, andtar-fs) are not new additions but are being explicitly declared here rather than inherited. The commit message clarifies the PR scope is "migrate away from shared package," not just import path standardization. The exact version pinning forlangfuseandtar-fspackages is intentional for consistency during the migration.
| "@octokit/rest": "^21.0.2", | ||
| "langfuse": "^3.32.0", | ||
| "langfuse-core": "^3.37.0", | ||
| "tar-fs": "^3.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, check for tar-fs usage in shared package source
find shared/src -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | head -20Repository: youngchingjui/issue-to-pr
Length of output: 1090
🏁 Script executed:
# Search for tar-fs imports/usage in shared package
rg "tar-fs|tarfs" shared/ -nRepository: youngchingjui/issue-to-pr
Length of output: 235
🏁 Script executed:
# Check package.json files in the repository to understand dependency structure
fd "package.json" -t f | head -10Repository: youngchingjui/issue-to-pr
Length of output: 235
🏁 Script executed:
# View the shared/package.json to see the full context
cat -n shared/package.jsonRepository: youngchingjui/issue-to-pr
Length of output: 1919
🏁 Script executed:
# Check if consumer packages have tar-fs in their dependencies
for pkg in apps/openai-realtime-agents/package.json apps/storybook/package.json apps/workers/workflow-workers/package.json apps/www/package.json package.json; do
echo "=== Checking $pkg ==="
grep -E '"tar-fs"|"@types/tar-fs"' "$pkg" || echo " tar-fs not found"
doneRepository: youngchingjui/issue-to-pr
Length of output: 399
🏁 Script executed:
# Check what container.ts exports and how it's used
cat -n shared/src/lib/utils/container.ts | head -30Repository: youngchingjui/issue-to-pr
Length of output: 1281
🏁 Script executed:
# Check if container.ts or functions from it are exported from shared index
rg "container|pack" shared/src/index.ts -A 2 -B 2Repository: youngchingjui/issue-to-pr
Length of output: 128
🏁 Script executed:
# Check what shared exports - look for index or barrel files
fd -e ts -e js "index\|barrel" shared/src/ | head -20Repository: youngchingjui/issue-to-pr
Length of output: 51
🏁 Script executed:
# Check if shared package has explicit exports defined
grep -r "export" shared/src/ -l | head -10Repository: youngchingjui/issue-to-pr
Length of output: 611
🏁 Script executed:
# Look for how container is imported elsewhere
rg "from.*container|import.*container" --type ts -n | grep -v node_modulesRepository: youngchingjui/issue-to-pr
Length of output: 2495
🏁 Script executed:
# Check if the PR modifies consumer package.json files
git diff --name-only | grep -E "(package\.json|workflow-workers)" 2>/dev/null || echo "Git diff unavailable, checking file modifications"Repository: youngchingjui/issue-to-pr
Length of output: 118
Moving tar-fs to peerDependencies is a breaking change—coordinate with consumer packages.
tar-fs is a runtime dependency actively used by shared/src/lib/utils/container.ts (imported at line 4), which is consumed by multiple packages including app, lib/workflows, and apps/workers/workflow-workers. Moving it to peerDependencies requires all consumers to install it, but currently only apps/workers/workflow-workers has tar-fs in its dependencies. The other consumers (apps/openai-realtime-agents, apps/storybook, apps/www, and root) lack this dependency and will fail at runtime if they import container utilities.
This dependency scope change should either:
- Revert to
dependenciesif shared is responsible for providing it, or - Be split into a separate PR that coordinates
tar-fsinstallation across all consumer packages
This change is unrelated to the stated PR objective of standardizing import paths and should not be included without explicit coordination.
🤖 Prompt for AI Agents
In shared/package.json around line 58, the change moving "tar-fs" to
peerDependencies is a breaking change because shared/src/lib/utils/container.ts
(imported at line 4) requires tar-fs at runtime and multiple consumer packages
do not declare it; either revert "tar-fs" back to dependencies in this PR so
shared continues to provide it to consumers, or remove this dependency change
from this PR and create a separate coordinated PR that adds tar-fs to every
consumer (apps/openai-realtime-agents, apps/storybook, apps/www, root, etc.) and
documents the required version; do not include this dependency scope change in
the import-path-standardization PR without explicit coordination.
Summary
Standardizes import paths in the shared package and its consumers to use the
@/sharedprefix consistently.Changes
@/to@/shared/@/to@/shared/shared/to@/shared/Motivation
The codebase currently mixes three different import patterns:
shared/(bare module name)@/(TypeScript path alias)@/shared/(TypeScript path alias with explicit shared prefix)This PR standardizes on pattern #3 (
@/shared/) for all shared package imports to:Testing
Part of Epic
This is a small, independent refactor extracted from PR #1452 to reduce that PR's size and complexity.
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 [email protected]
Summary by CodeRabbit
Refactor
Chores
Style
Backwards-compatible change
✏️ Tip: You can customize this high-level summary in your review settings.