[codex] Refactor chat session boundaries#81
Merged
Conversation
Restructure the chat session engine around explicit class boundaries and types contracts. Records, leases, archives, and repository behavior now live in focused modules with types.ts entry points, while old loose helper functions were removed or folded into class methods. This makes session behavior easier to discover and extend: callers can scan each subfolder contract first, then follow the class implementation for the owning behavior instead of copying scattered helper patterns.
Configure @/* to resolve to src/* across TypeScript, Vite, Vitest, and shadcn component aliases, then update the session-service folder to use the alias for cross-module imports. The build now runs tsc-alias after TypeScript emits server and CLI files, so source imports can stay readable without leaving unresolved alias paths in published Node output.
Move the root conversation session service config and contract types into sessions/types.ts so the main session boundary follows the same contract-first pattern as records, leases, archives, and repository modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactor the chat session engine folder around explicit class boundaries and lightweight
types.tscontracts.FileChatArchiveRepository.FileChatSessionRepositoryinstances and removed loose exported helper functions from the repository implementation.ChatSessionTitlesunder records as session metadata behavior.@/* -> src/*alias and updated the session-service folder to use it for cross-module imports.tsc-aliasto the build so server/CLI output rewrites source aliases before publishing.Why
The previous session folder mixed domain helpers, storage helpers, and thin wrapper functions. That made it hard to tell where new behavior belonged and encouraged future agents to copy scattered function patterns. The new structure makes each boundary discoverable: scan
types.tsfor the contract, then read the owning class for implementation details.The path alias keeps those boundaries readable without long
../../../..imports, whiletsc-aliaspreserves runtime safety for emitted Node files.Validation
yarn lintyarn typecheckyarn build